<?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: Regular expression challenge</title>
	<atom:link href="http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/</link>
	<description>A tool for designers dealing with programmers dealing with designers...</description>
	<pubDate>Tue, 14 Oct 2008 02:04:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-729</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Fri, 19 Oct 2007 09:44:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-729</guid>
		<description>Well done Thijs!

Thanks for point that error out, I'll look into that bug.</description>
		<content:encoded><![CDATA[<p>Well done Thijs!</p>
<p>Thanks for point that error out, I&#8217;ll look into that bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs Lensselink</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-728</link>
		<dc:creator>Thijs Lensselink</dc:creator>
		<pubDate>Fri, 19 Oct 2007 09:36:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-728</guid>
		<description>Bit late as usual. But here goes:

reg exp: (from&#124;to&#124;via)\s(.+?(?=( ?from &#124; ?to &#124; ?via &#124;$)))
Replacement: ${1}: "${2}"

By the way i got an error on submitting
Warning: join() [function.join]: Bad arguments. in /path/to/plugins/spambam/spambam.php on line 43
We don't allow comment spam here. Javascript is required to submit a comment.</description>
		<content:encoded><![CDATA[<p>Bit late as usual. But here goes:</p>
<p>reg exp: (from|to|via)\s(.+?(?=( ?from | ?to | ?via |$)))<br />
Replacement: ${1}: &#8220;${2}&#8221;</p>
<p>By the way i got an error on submitting<br />
Warning: join() [function.join]: Bad arguments. in /path/to/plugins/spambam/spambam.php on line 43<br />
We don&#8217;t allow comment spam here. Javascript is required to submit a comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-727</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Fri, 19 Oct 2007 09:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-727</guid>
		<description>Here's mine:-
$output = preg_replace("/\s?\b(from&#124;to&#124;via)\b \b([\w-]+([,][\s][\w]+([\s][\w]+)?)?)/i", ' $1: "$2" ', $string);</description>
		<content:encoded><![CDATA[<p>Here&#8217;s mine:-<br />
$output = preg_replace(&#8221;/\s?\b(from|to|via)\b \b([\w-]+([,][\s][\w]+([\s][\w]+)?)?)/i&#8221;, &#8216; $1: &#8220;$2&#8243; &#8216;, $string);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-721</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Fri, 19 Oct 2007 00:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-721</guid>
		<description>Well done everyone who has entered so far, I shall post my solution tomorrow and let you know which one I thought was best. Some of them look at lot better than mine :)

I can't offer any prizes unless I could get a sponsor :( only my praise :)</description>
		<content:encoded><![CDATA[<p>Well done everyone who has entered so far, I shall post my solution tomorrow and let you know which one I thought was best. Some of them look at lot better than mine <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I can&#8217;t offer any prizes unless I could get a sponsor <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> only my praise <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: Peter</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-720</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Fri, 19 Oct 2007 00:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-720</guid>
		<description>foreach($strings as $string) {
     $output = preg_replace("/(from&#124;to&#124;via) (\S*+(?: (?!from\b&#124;to\b&#124;via\b)\S*+)*+)/i", '\1: "\2"', $string);
     echo "{ " . $output . " }&#60;br&#62;";
 }</description>
		<content:encoded><![CDATA[<p>foreach($strings as $string) {<br />
     $output = preg_replace(&#8221;/(from|to|via) (\S*+(?: (?!from\b|to\b|via\b)\S*+)*+)/i&#8221;, &#8216;\1: &#8220;\2&#8243;&#8216;, $string);<br />
     echo &#8220;{ &#8221; . $output . &#8221; }&lt;br&gt;&#8221;;<br />
 }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The-Wildcat</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-719</link>
		<dc:creator>The-Wildcat</dc:creator>
		<pubDate>Thu, 18 Oct 2007 23:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-719</guid>
		<description>foreach($strings as $string) {
	$output = preg_replace("/(from&#124;to&#124;via)\s{1}([a-z\-]{0,})(?(?=\,)([a-z\s,]{0,16}\S&#124;to))/i", 
        ' $1: "$2$3" ', $string);
	echo "{" . $output . "}&#60;br&#62;";
}

Very bad, but it works xD
And now, i go to bed</description>
		<content:encoded><![CDATA[<p>foreach($strings as $string) {<br />
	$output = preg_replace(&#8221;/(from|to|via)\s{1}([a-z\-]{0,})(?(?=\,)([a-z\s,]{0,16}\S|to))/i&#8221;,<br />
        &#8216; $1: &#8220;$2$3&#8243; &#8216;, $string);<br />
	echo &#8220;{&#8221; . $output . &#8220;}&lt;br&gt;&#8221;;<br />
}</p>
<p>Very bad, but it works xD<br />
And now, i go to bed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adnan Ali</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-718</link>
		<dc:creator>Adnan Ali</dc:creator>
		<pubDate>Thu, 18 Oct 2007 22:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-718</guid>
		<description>Sorry for the spam, but I figured that could be simplified to:

"/(to&#124;from&#124;via) (.*?)(?= (?1) &#124;$)/i"
‘\1: “\2″′

/embarrased</description>
		<content:encoded><![CDATA[<p>Sorry for the spam, but I figured that could be simplified to:</p>
<p>&#8220;/(to|from|via) (.*?)(?= (?1) |$)/i&#8221;<br />
‘\1: “\2″′</p>
<p>/embarrased</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adnan Ali</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-717</link>
		<dc:creator>Adnan Ali</dc:creator>
		<pubDate>Thu, 18 Oct 2007 22:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-717</guid>
		<description>Ah, clever, comments are moderated so you see them first.

Here it is:
match:
"/((to&#124;from&#124;via) )(.*?)( ?)(?=(?1)&#124;$)/i"

replace:
'\2: "\3"\4'</description>
		<content:encoded><![CDATA[<p>Ah, clever, comments are moderated so you see them first.</p>
<p>Here it is:<br />
match:<br />
&#8220;/((to|from|via) )(.*?)( ?)(?=(?1)|$)/i&#8221;</p>
<p>replace:<br />
&#8216;\2: &#8220;\3&#8243;\4&#8242;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adnan Ali</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-716</link>
		<dc:creator>Adnan Ali</dc:creator>
		<pubDate>Thu, 18 Oct 2007 22:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-716</guid>
		<description>I got it! Should I post the solution here?</description>
		<content:encoded><![CDATA[<p>I got it! Should I post the solution here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Johnston</title>
		<link>http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-715</link>
		<dc:creator>Josh Johnston</dc:creator>
		<pubDate>Thu, 18 Oct 2007 21:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/#comment-715</guid>
		<description>I had to add the U modifier at the end to make this one work so there is probably something better.
Enjoy

&#60;?php
$output = preg_replace('/(from&#124;via&#124;to)\s(.+)(?=(?: from&#124; via&#124; to&#124;$))/iU', '$1: "$2"', $string);
?&#62;</description>
		<content:encoded><![CDATA[<p>I had to add the U modifier at the end to make this one work so there is probably something better.<br />
Enjoy</p>
<p>&lt;?php<br />
$output = preg_replace(&#8217;/(from|via|to)\s(.+)(?=(?: from| via| to|$))/iU&#8217;, &#8216;$1: &#8220;$2&#8243;&#8216;, $string);<br />
?&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
