<?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>FettesPS &#187; regular expression</title>
	<atom:link href="http://www.fettesps.com/tag/regular-expression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Sun, 22 Jan 2012 18:21:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP &#8211; Auto Convert URLs to Links in a Block of Text</title>
		<link>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-auto-convert-urls-to-links-in-a-block-of-text</link>
		<comments>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 22:13:43 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[preg_match]]></category>
		<category><![CDATA[preg_replace]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=269</guid>
		<description><![CDATA[Whether you&#8217;re creating your own custom blog, tweaking a CMS or building a plugin this is one block of code that can come in very handy. I&#8217;ve used this many times over the years and it has always served me well. I will admit, I am terrible with regular expressions and found this a while [...]]]></description>
			<content:encoded><![CDATA[<p>Whether you&#8217;re creating your own custom blog, tweaking a CMS or building a plugin this is one block of code that can come in very handy.  I&#8217;ve used this many times over the years and it has always served me well.  I will admit, I am terrible with regular expressions and found this a while back, so I can take no credit for it. Usually I use something like <a href="http://txt2re.com/" target="_new">txt2re</a> when I a cutomer regular expression.</p>
<pre class="brush: php; title: ; notranslate">$pattern = &quot;@\b(https?://)?(([0-9a-zA-Z_!~*'().&amp;=+$%-]+:)?[0-9a-zA-Z_!~*'().&amp;=+$%-]+\@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+\.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z]\.[a-zA-Z]{2,6})(:[0-9]{1,4})?((/[0-9a-zA-Z_!~*'().;?:\@&amp;=+$,%#-]+)*/?)@&quot;;

$text = preg_replace($pattern, '&lt;a href=&quot;\0&quot;&gt;\0&lt;/a&gt;', $text_raw);</pre>
<p>Hopefully someone else finds it useful <img src='http://www.fettesps.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

