<?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: Parsing Twitter Usernames, Hashtags and URLs with JavaScript</title>
	<atom:link href="http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 17 Mar 2010 20:56:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: How to Parse Twitter Usernames, Hashtags and URLs in C# 3.0 &#187; jesal gadhia</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-329</link>
		<dc:creator>How to Parse Twitter Usernames, Hashtags and URLs in C# 3.0 &#187; jesal gadhia</dc:creator>
		<pubDate>Sun, 07 Mar 2010 21:54:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-329</guid>
		<description>[...] was inspired by Simon Whatley&#8217;s post about doing something similar using prototyping with [...]</description>
		<content:encoded><![CDATA[<p>[...] was inspired by Simon Whatley&#8217;s post about doing something similar using prototyping with [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nic Johnson</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-328</link>
		<dc:creator>Nic Johnson</dc:creator>
		<pubDate>Tue, 09 Feb 2010 22:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-328</guid>
		<description>Aaaah this is good. I&#039;m going to start doing this :)</description>
		<content:encoded><![CDATA[<p>Aaaah this is good. I&#8217;m going to start doing this <img src='http://www.simonwhatley.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carter Cole</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-327</link>
		<dc:creator>Carter Cole</dc:creator>
		<pubDate>Sat, 23 Jan 2010 22:58:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-327</guid>
		<description>i spent a couple hours writing regex before i found this... thanks for your work :) i should know by now almost everything has been done before</description>
		<content:encoded><![CDATA[<p>i spent a couple hours writing regex before i found this&#8230; thanks for your work <img src='http://www.simonwhatley.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  i should know by now almost everything has been done before</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fusionteam</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-326</link>
		<dc:creator>fusionteam</dc:creator>
		<pubDate>Wed, 16 Dec 2009 14:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-326</guid>
		<description>@simon,

Thanks for this. Will save me a job! Hope things are going well with you at the moment.

Cheers</description>
		<content:encoded><![CDATA[<p>@simon,</p>
<p>Thanks for this. Will save me a job! Hope things are going well with you at the moment.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck Bergeron</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-325</link>
		<dc:creator>Chuck Bergeron</dc:creator>
		<pubDate>Wed, 28 Oct 2009 22:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-325</guid>
		<description>Super helpful, thanks! Made use of it on our website.

Cheers mate.

` C</description>
		<content:encoded><![CDATA[<p>Super helpful, thanks! Made use of it on our website.</p>
<p>Cheers mate.</p>
<p>` C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-324</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 24 Jul 2009 21:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-324</guid>
		<description>anyone able to build this into a wordpress plugin??!

that would be killer!</description>
		<content:encoded><![CDATA[<p>anyone able to build this into a wordpress plugin??!</p>
<p>that would be killer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jim jim</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-323</link>
		<dc:creator>jim jim</dc:creator>
		<pubDate>Wed, 24 Jun 2009 03:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-323</guid>
		<description>Thank you so much for this script. It is so helpful and saved me many hours and headaches.</description>
		<content:encoded><![CDATA[<p>Thank you so much for this script. It is so helpful and saved me many hours and headaches.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oscar Rottink</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-322</link>
		<dc:creator>Oscar Rottink</dc:creator>
		<pubDate>Thu, 30 Apr 2009 08:28:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-322</guid>
		<description>Thanks Simon, this was very very usefull! I&#039;m not a real programmer but sometimes I have an idea and like to try to realize it. This helped me so much.
@Mark Quenzada, great! I had the same problem with multiple hashes and urls, this works like a charm. Happy person here :)</description>
		<content:encoded><![CDATA[<p>Thanks Simon, this was very very usefull! I&#8217;m not a real programmer but sometimes I have an idea and like to try to realize it. This helped me so much.<br />
@Mark Quenzada, great! I had the same problem with multiple hashes and urls, this works like a charm. Happy person here <img src='http://www.simonwhatley.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Quezada</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-321</link>
		<dc:creator>Mark Quezada</dc:creator>
		<pubDate>Fri, 24 Apr 2009 01:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-321</guid>
		<description>@Jonathan regarding multiple hashtags, you&#039;ll want to add the &quot;global&quot; modifier to the regular expression, ie:

/[#]+[A-Za-z0-9-_]+/g

... the &quot;/g&quot; instead of just &quot;/&quot; will match all occurrences.</description>
		<content:encoded><![CDATA[<p>@Jonathan regarding multiple hashtags, you&#8217;ll want to add the &#8220;global&#8221; modifier to the regular expression, ie:</p>
<p>/[#]+[A-Za-z0-9-_]+/g</p>
<p>&#8230; the &#8220;/g&#8221; instead of just &#8220;/&#8221; will match all occurrences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript/comment-page-1#comment-320</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 04 Apr 2009 21:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=646#comment-320</guid>
		<description>Not sure what happened with the previous comment, but here is the correct code:

&lt;pre lang=&quot;text&quot;&gt;
function twitterize($raw_text) {
	$output = $raw_text;

	// parse urls
	$pattern = &#039;/([A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&amp;\?\/.=]+)/i&#039;;
	$replacement = &#039;&lt;a href=&quot;${1}&quot; rel=&quot;nofollow&quot;&gt;${1}&lt;/a&gt;&#039;;
	$output = preg_replace($pattern, $replacement, $output);

	// parse usernames
	$pattern = &#039;/[@]+([A-Za-z0-9-_]+)/&#039;;
	$replacement = &#039;&lt;a href=&quot;http://twitter.com/${1}&quot; rel=&quot;nofollow&quot;&gt;@${1}&lt;/a&gt;&#039;;
	$output = preg_replace($pattern, $replacement, $output);

	// parse hashtags
	$pattern = &#039;/[#]+([A-Za-z0-9-_]+)/&#039;;
	$replacement = &#039;&lt;a href=&quot;http://search.twitter.com/search?q=%23${1}&quot; rel=&quot;nofollow&quot;&gt;#${1}&lt;/a&gt;&#039;;
	$output = preg_replace($pattern, $replacement, $output);

	return $output;
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Not sure what happened with the previous comment, but here is the correct code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">function twitterize($raw_text) {
	$output = $raw_text;
&nbsp;
	// parse urls
	$pattern = '/([A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&amp;amp;\?\/.=]+)/i';
	$replacement = '&lt;a href=&quot;${1}&quot; rel=&quot;nofollow&quot;&gt;${1}&lt;/a&gt;';
	$output = preg_replace($pattern, $replacement, $output);
&nbsp;
	// parse usernames
	$pattern = '/[@]+([A-Za-z0-9-_]+)/';
	$replacement = '&lt;a href=&quot;http://twitter.com/${1}&quot; rel=&quot;nofollow&quot;&gt;@${1}&lt;/a&gt;';
	$output = preg_replace($pattern, $replacement, $output);
&nbsp;
	// parse hashtags
	$pattern = '/[#]+([A-Za-z0-9-_]+)/';
	$replacement = '&lt;a href=&quot;http://search.twitter.com/search?q=%23${1}&quot; rel=&quot;nofollow&quot;&gt;#${1}&lt;/a&gt;';
	$output = preg_replace($pattern, $replacement, $output);
&nbsp;
	return $output;
}</pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>
