<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean&#039;s Blog &#187; js</title>
	<atom:link href="http://seanbehan.com/tag/js/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 08 Sep 2010 16:10:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Parse for Links with Prototype JS</title>
		<link>http://seanbehan.com/programming/parse-for-links-with-prototype-js/</link>
		<comments>http://seanbehan.com/programming/parse-for-links-with-prototype-js/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 15:23:06 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=79</guid>
		<description><![CDATA[Parsing for links with the Prototype javascript library is easy. Here is the pattern for finding links /(http&#124;https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^ =%&#38;amp;:/~\+#]*[\w\-\@?^=%&#38;amp;/~\+#])?/ And to implement it you can loop through your containers that might contain links document.observe("dom:loaded", function(){ var posts = $$("div#posts"); for(var i = 0; i &#60; posts.length; i++){ var link_regex = /(http&#124;https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^ =%&#38;amp;:/~\+#]*[\w\-\@?^=%&#38;amp;/~\+#])?/; var parsed_string = [...]]]></description>
			<content:encoded><![CDATA[<p>Parsing for links with the Prototype javascript library is easy. Here is the pattern for finding links</p>
<pre>
/(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^
=%&amp;amp;:/~\+#]*[\w\-\@?^=%&amp;amp;/~\+#])?/
</pre>
<p>And to implement it you can loop through your containers that might contain links</p>
<pre>
document.observe("dom:loaded", function(){
var posts = $$("div#posts");
for(var i = 0; i &lt; posts.length; i++){
var link_regex = /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^
=%&amp;amp;:/~\+#]*[\w\-\@?^=%&amp;amp;/~\+#])?/;
var parsed_string = posts[i].innerHTML.gsub(link_regex, '&lt;a href="#{0}"
target="_blank"&gt;#{0}&lt;/a&gt;');
posts[i].innerHTML = parsed_string;
}
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/parse-for-links-with-prototype-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
