<?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"
	>
<channel>
	<title>Comments on: Javascript regular expressions</title>
	<atom:link href="http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/</link>
	<description>A tool for designers dealing with programmers dealing with designers...</description>
	<pubDate>Fri, 12 Mar 2010 05:03:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1676</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Tue, 29 Dec 2009 09:23:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1676</guid>
		<description>var str = "hello [bob] hello hello [bob]!";
str=str.replace(/\[bob\]/g,'"bob"');</description>
		<content:encoded><![CDATA[<p>var str = &#8220;hello [bob] hello hello [bob]!&#8221;;<br />
str=str.replace(/\[bob\]/g,&#8217;&#8221;bob&#8221;&#8216;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manish</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1675</link>
		<dc:creator>Manish</dc:creator>
		<pubDate>Tue, 29 Dec 2009 05:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1675</guid>
		<description>if 
var str = "hello [bob] hello hello [bob]!";
then how to replace "[bob]" with "bob" only through javascript.
Can anyone sovle it?</description>
		<content:encoded><![CDATA[<p>if<br />
var str = &#8220;hello [bob] hello hello [bob]!&#8221;;<br />
then how to replace &#8220;[bob]&#8221; with &#8220;bob&#8221; only through javascript.<br />
Can anyone sovle it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1462</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Mon, 23 Feb 2009 10:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1462</guid>
		<description>@mar

I think this is what you mean:-
&lt;pre lang="javascript"&gt;
var str = "hello bob hello hello bob!";
var s = "bob";
alert( str.replace(new RegExp(s,'g'), function(str) { return 'yes';}));
&lt;/pre&gt;

You need to use the RegExp constructor to dynamically create regular expressions.</description>
		<content:encoded><![CDATA[<p>@mar</p>
<p>I think this is what you mean:-</p>
<pre lang="javascript">
var str = "hello bob hello hello bob!";
var s = "bob";
alert( str.replace(new RegExp(s,'g'), function(str) { return 'yes';}));
</pre>
<p>You need to use the RegExp constructor to dynamically create regular expressions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mar canet</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1461</link>
		<dc:creator>Mar canet</dc:creator>
		<pubDate>Sun, 22 Feb 2009 22:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1461</guid>
		<description>I don't know how to add a variable string this remplace and regular expresion function.

var str = "hello bob hello hello bob!";
var s = "bob";
alert( str.replace(/s/+/g, function(str) { return str.replace(/s/g,'yes');}) );

could you show how to do it?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know how to add a variable string this remplace and regular expresion function.</p>
<p>var str = &#8220;hello bob hello hello bob!&#8221;;<br />
var s = &#8220;bob&#8221;;<br />
alert( str.replace(/s/+/g, function(str) { return str.replace(/s/g,&#8217;yes&#8217;);}) );</p>
<p>could you show how to do it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronald</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1111</link>
		<dc:creator>Ronald</dc:creator>
		<pubDate>Sat, 02 Feb 2008 13:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1111</guid>
		<description>Good stuff Gareth!

@.mario: yeah exactly that was the stuff I needed to wrap my head around. :)</description>
		<content:encoded><![CDATA[<p>Good stuff Gareth!</p>
<p>@.mario: yeah exactly that was the stuff I needed to wrap my head around. <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: riahmatic</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1110</link>
		<dc:creator>riahmatic</dc:creator>
		<pubDate>Sat, 02 Feb 2008 01:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1110</guid>
		<description>you can also eval a string formated like a regex to pass variables:

var a = '/[test]+/';
alert(eval(a+'i').exec('TeSt'));</description>
		<content:encoded><![CDATA[<p>you can also eval a string formated like a regex to pass variables:</p>
<p>var a = &#8216;/[test]+/&#8217;;<br />
alert(eval(a+&#8217;i').exec(&#8217;TeSt&#8217;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: .mario</title>
		<link>http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1109</link>
		<dc:creator>.mario</dc:creator>
		<pubDate>Fri, 01 Feb 2008 23:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/02/01/javascript-regular-expressions/#comment-1109</guid>
		<description>Nice article! I especially "like" the fact that JS allows match sniffing - try to use console.dir(RegExp) with noscript installed ;)</description>
		<content:encoded><![CDATA[<p>Nice article! I especially &#8220;like&#8221; the fact that JS allows match sniffing - try to use console.dir(RegExp) with noscript installed <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
