<?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>johnsonroad.net &#187; Programming</title>
	<atom:link href="http://johnsonroad.net/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnsonroad.net/blog</link>
	<description>Quidquid latine dictum sit, altum sonatur. Quod erat demonstrandum.</description>
	<lastBuildDate>Sat, 25 Jul 2009 23:55:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>sanitizing a phone number using a regular expression</title>
		<link>http://johnsonroad.net/blog/2007/11/08/sanitizing-a-phone-number-using-a-regular-expression/</link>
		<comments>http://johnsonroad.net/blog/2007/11/08/sanitizing-a-phone-number-using-a-regular-expression/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 19:58:01 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnsonroad.net/blog/2007/11/08/sanitizing-a-phone-number-using-a-regular-expression/</guid>
		<description><![CDATA[Expanding on the regular expression found in this blog post on validating phone numbers, I&#8217;ve found a regex that seems to match any U.S. phone number I can throw at it: ^[\(]?(\d{0,3})[\)]?[\s]?[\-]?(\d{3})[\s]?[\-]?(\d{4})[\s]?[a-zA-Z]*?[\.]?[\s]?(\d*)$ Explanation of this regex: ^[\(]? string begins with optional open paren (\d{0,3}) 3 digit area code, captured [\)]? optional close paren [\s]? optional [...]]]></description>
			<content:encoded><![CDATA[<p>Expanding on the regular expression found in this blog post on <a href="http://benramsey.com/archives/making-it-valid-telephone-numbers/">validating phone numbers</a>, I&#8217;ve found a regex that seems to match any U.S. phone number I can throw at it:</p>
<p>^[\(]?(\d{0,3})[\)]?[\s]?[\-]?(\d{3})[\s]?[\-]?(\d{4})[\s]?[a-zA-Z]*?[\.]?[\s]?(\d*)$</p>
<p><code><br />
Explanation of this regex:<br />
^[\(]?		string begins with optional open paren<br />
(\d{0,3})	3 digit area code, captured<br />
[\)]?		optional close paren<br />
[\s]?		optional whitespace<br />
[\-]?		optional dash<br />
(\d{3})		3 digit exchange code, captured<br />
[\s]?		optional whitespace<br />
[\-]?		optional dash<br />
(\d{4})		4 digit phone number, captured<br />
[\s]?		optional whitespace<br />
[a-zA-Z]*?	optional word (matches 'ext','extension','x', etc.)<br />
[\.]?		optional period (matches the '.' in 'ext.')<br />
[\s]?		optional whitespace<br />
(\d*)$		end of the string is the extension number, which can be any length<br />
</code>			</p>
]]></content:encoded>
			<wfw:commentRss>http://johnsonroad.net/blog/2007/11/08/sanitizing-a-phone-number-using-a-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

