[Chicago] regular expression headache

Tim Ottinger tottinge at gmail.com
Sun Jan 12 00:12:25 CET 2014


is the regex being run in a different engine?
Quoting?
Expanding/interpolating?



On Sat, Jan 11, 2014 at 2:47 PM, Robert Spelich <rlspelich at gmail.com> wrote:

> Can anyone offer me a suggestion as to why a regular expression that
> validates on a testing tool would not match on the same string when run in
> a script or directly in the interpreter? I used 2 different online tools,
> one a general expression tool and one Python specific. They both matched,
> when run locally it does not match.
>
> I am using an re from a cookbook to match addresses in a database that
> start with a PO Box address. I am using 2.7. I am stumped.
>
> po_box = re.compile('^(?:Post (?:Office )?|P[. ]?O\.? )?Box\b')
>
> Thanks in advance if anyone can help me out.
>
> -Bob S.
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>


-- 
Tim Ottinger, Sr. Consultant, Industrial Logic
-------------------------------------
http://www.industriallogic.com/
http://agileinaflash.com/
http://agileotter.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20140111/ac60450b/attachment.html>


More information about the Chicago mailing list