<div dir="ltr"><div><br></div>Putting specific numbers in your expressions like that really hamstrings you if things don't match up to the exact counts you specify.<div><br></div><div>To match<font face="Calibri, sans-serif"><span style="font-size:15px"> your city, just do this:</span></font></div>
<div><br></div><div><span style="font-family:Calibri,sans-serif;font-size:15px">/^\s*(\w.*?),\s+\w{2}\s+\d{5}/</span></div><div><span style="font-family:Calibri,sans-serif;font-size:15px"><br></span></div><div><span style="font-family:Calibri,sans-serif;font-size:15px">Start of line, optionally followed by 0 or more spaces, (start capture) followed by a word character, followed by a non-greedy match of any number of characters (stop capture) up to a comma, followed by 1 or more spaces, followed by two word characters, followed by 1 or more spaces, followed by 5 digits.</span></div>
<div><br></div><div class="gmail_extra"><br clear="all"><div>-- <br>Andy Harrison<br>public key: 0x67518262</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><br><br><div class="gmail_quote">On Fri, Aug 9, 2013 at 7:37 PM, Bryon Baker <span dir="ltr"><<a href="mailto:bbaker@copesan.com" target="_blank">bbaker@copesan.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="color:#1f497d">Sorry back to the drawing board does not work if the city is two words.<u></u><u></u></span></p><div class="im">
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Bryon Baker<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Network Operations Manager<u></u><u></u></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">Copesan</span></i></b><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> - Specialists in Pest Solutions<u></u><u></u></span></i></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="tel:800-267-3726" value="+18002673726" target="_blank">800-267-3726</a> • <a href="tel:262-783-6261%20ext.%202296" value="+12627836261" target="_blank">262-783-6261 ext. 2296</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="mailto:cstephan@copesan.com" target="_blank">bbaker@copesan.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="http://www.copesan.com/" target="_blank"><span style>www.copesan.com</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">"Servicing North America with Local Care"</span></i></b><span style="color:#1f497d"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
</div><div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Bryon Baker
<br>
<b>Sent:</b> Friday, August 09, 2013 6:05 PM<br>
<b>To:</b> '<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>'<br>
<b>Subject:</b> RE: Regex <u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">Update this is what I came up with seems to work Thoughts?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Tries to anchor begin of line but found it is white space.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">/\s{10}([\w{2},]+),\s*(\w{2})\s*(\d{5})/<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Ok this question is to the regex experts<u></u><u></u></p>
<p class="MsoNormal">I have this email content and I want returned to me the City.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">116 Walker Ave.<br>
Berlin Circle Plaza<br>
West Berlin, NJ 08091<br>
Store Contact: MICHAEL OCONNOR - SOPASM<br>
Phone: <a href="tel:%28856%29719-0335" value="+18567190335" target="_blank">(856)719-0335</a><br>
Fax : <a href="tel:%28856%29719-2216" value="+18567192216" target="_blank">(856)719-2216</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks in advance for you expert help.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Bryon Baker<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Network Operations Manager<u></u><u></u></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">Copesan</span></i></b><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> - Specialists in Pest Solutions<u></u><u></u></span></i></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="tel:800-267-3726" value="+18002673726" target="_blank">800-267-3726</a> • <a href="tel:262-783-6261%20ext.%202296" value="+12627836261" target="_blank">262-783-6261 ext. 2296</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="mailto:cstephan@copesan.com" target="_blank">bbaker@copesan.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="http://www.copesan.com/" target="_blank"><span style>www.copesan.com</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">"Servicing North America with Local Care"</span></i></b><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>
</blockquote></div><br></div></div>