<?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>acloudtree &#187; preg_match</title>
	<atom:link href="http://www.acloudtree.com/tag/preg_match/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acloudtree.com</link>
	<description>Programming, Computers, Writing, Economics, and Life</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Agapage : lastName regex</title>
		<link>http://www.acloudtree.com/agapage-lastname-regex/</link>
		<comments>http://www.acloudtree.com/agapage-lastname-regex/#comments</comments>
		<pubDate>Thu, 13 May 2010 21:02:31 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[Agapage]]></category>
		<category><![CDATA[Nerd]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[preg_match]]></category>
		<category><![CDATA[REGEX]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[txt]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=753</guid>
		<description><![CDATA[So I met with the Children&#8217;s minister at my church and she reported a bug with Agapage. It was a pretty simple fix. Basically her last name was something I didn&#8217;t account for, you see it consists of two words. Example : &#8216;Van Hoorst&#8217; And the filter that I had originally created was only searching [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.acloudtree.com/wp-content/uploads/2010/05/mastering_regular_expressions.jpg"><img class="alignleft size-medium wp-image-762" title="mastering_regular_expressions" src="http://www.acloudtree.com/wp-content/uploads/2010/05/mastering_regular_expressions-224x300.jpg" alt="" width="224" height="300" /></a>So I met with the Children&#8217;s minister at my church and she reported a bug with <a title="Agapage SMS and Txt based paging" href="http://www.agapage.com">Agapage</a>. It was a pretty simple fix. Basically her last name was something I didn&#8217;t account for, you see it consists of two words.</p>
<p>Example : &#8216;Van Hoorst&#8217;</p>
<p>And the filter that I had originally created was only searching for one continuous string.</p>
<p>Here is the regular expression <strong>before</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[a-zA-Z\']+/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">last_name</span><span style="color: #339933;">,</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and here is what I ended up with <strong>after</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[a-zA-Z\']+\s{0,1}[a-zA-Z\']*/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">last_name</span><span style="color: #339933;">,</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I also trimmed any trailing spaces afterward just to clean things up.</p>
<p>-later<br />
jared</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/agapage-lastname-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

