<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JavaScript, Regex, and Unicode</title>
	<atom:link href="http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:18:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Stefan</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/comment-page-1#comment-181523</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Wed, 25 Jan 2012 21:27:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode#comment-181523</guid>
		<description>I had an issue in BigMachines where the only way to solve a business need was to add some funky footer JS script... the issue there was that IE would not match SPACE characters when replacing string content. The source string included &nbsp; characters in the HTML source instead of spaces. Now in the regular expression, [\s] did not match &nbsp;. Adding the unicode character to the regular expression addressed the IE limitation =&gt; [\s\u00A0].</description>
		<content:encoded><![CDATA[<p>I had an issue in BigMachines where the only way to solve a business need was to add some funky footer JS script&#8230; the issue there was that IE would not match SPACE characters when replacing string content. The source string included &amp;nbsp; characters in the HTML source instead of spaces. Now in the regular expression, [\s] did not match &amp;nbsp;. Adding the unicode character to the regular expression addressed the IE limitation =&gt; [\s\u00A0].</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sijo</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/comment-page-1#comment-162860</link>
		<dc:creator>Sijo</dc:creator>
		<pubDate>Mon, 12 Dec 2011 07:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode#comment-162860</guid>
		<description>Hi Steve,

Here is my code to validate a file name against blank spaces in an attachment for a sharepoint list.

----------------------------------------

 
function PreSaveAction() 
{ 
var attachment; 
var filename=&quot;&quot;; 
var fileNameSpecialCharacters = new RegExp(&#039;\\s&#039;, &#039;g&#039;); 
try { 
attachment = document.getElementById(&quot;idAttachmentsTable&quot;).getElementsByTagName(&quot;span&quot;)[0].firstChild; 
filename = attachment.data; 
} 
catch (e) { 
} 
if (fileNameSpecialCharacters.test(filename)) { 
alert(&quot;Please remove the special characters and white spaces from file attachment name.&quot;);
return false; 
} 
else { 
return true; 
} 
} 
-------------------------------------

Its working fine with all browsers except IE. Can you suggest me an aleternate way to fix this?

Is this an issue with the &#039;/s&#039; metacharacter?

BR,
Sijo</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Here is my code to validate a file name against blank spaces in an attachment for a sharepoint list.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>function PreSaveAction()<br />
{<br />
var attachment;<br />
var filename=&#8221;";<br />
var fileNameSpecialCharacters = new RegExp(&#8216;\\s&#8217;, &#8216;g&#8217;);<br />
try {<br />
attachment = document.getElementById(&#8220;idAttachmentsTable&#8221;).getElementsByTagName(&#8220;span&#8221;)[0].firstChild;<br />
filename = attachment.data;<br />
}<br />
catch (e) {<br />
}<br />
if (fileNameSpecialCharacters.test(filename)) {<br />
alert(&#8220;Please remove the special characters and white spaces from file attachment name.&#8221;);<br />
return false;<br />
}<br />
else {<br />
return true;<br />
}<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Its working fine with all browsers except IE. Can you suggest me an aleternate way to fix this?</p>
<p>Is this an issue with the &#8216;/s&#8217; metacharacter?</p>
<p>BR,<br />
Sijo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Higgins</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/comment-page-1#comment-136979</link>
		<dc:creator>David Higgins</dc:creator>
		<pubDate>Mon, 19 Sep 2011 22:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode#comment-136979</guid>
		<description>There&#039;s loads of handy JavaScript Unicode-related tools available at http://u-n-i.co/de/

They might solve this problem</description>
		<content:encoded><![CDATA[<p>There&#8217;s loads of handy JavaScript Unicode-related tools available at <a href="http://u-n-i.co/de/" rel="nofollow">http://u-n-i.co/de/</a></p>
<p>They might solve this problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saurabh</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/comment-page-1#comment-127549</link>
		<dc:creator>saurabh</dc:creator>
		<pubDate>Fri, 19 Aug 2011 05:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode#comment-127549</guid>
		<description>gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg</description>
		<content:encoded><![CDATA[<p>gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saurabh</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode/comment-page-1#comment-127548</link>
		<dc:creator>saurabh</dc:creator>
		<pubDate>Fri, 19 Aug 2011 05:41:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode#comment-127548</guid>
		<description>ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</description>
		<content:encoded><![CDATA[<p>ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</p>
]]></content:encoded>
	</item>
</channel>
</rss>

