RE: regex of the month (decade?)
[email protected] ("Stoll, Steven R.") Tue, 8 Jan 2008 09:59:04 -0500
| Newsgroups | perl.fwp |
|---|---|
| Message-ID | <[email protected]> |
After solving the case sensitivity issue, separating the alternations, and solving the un-escaped /, here is what we are left with. (p(ost)?[.\s]*o(ffice)?[.\s]*box) po(b|x|drawer|stoffice|[ ]bx|box) p[\/]o b(x|ox|uzon) a(partado|ptdo) Which matches: (p(ost)?.*o(ffice)?.*box) post(anynumberofanythingexceptnewline)office(anynumberofanythingexceptnewlin e)box p(anynumberofanythingexceptnewline)office(anynumberofanythingexceptnewline)b ox post(anynumberofanythingexceptnewline)o(anynumberofanythingexceptnewline)box p(anynumberofanythingexceptnewline)o(anynumberofanythingexceptnewline)box po(b|x|drawer|stoffice|[ ]bx|box) pob pox podrawer postoffice po bx pobox p[\/]o p/o b(x|ox|uzon) bx box buzon a(partado|ptdo) apartado aptdo I can't imagine what the original specs were, but it looks like a patch job gone awry. Steve -----Original Message----- From: Uri Guttman [mailto:[email protected]] Sent: Monday, January 07, 2008 5:06 PM To: Fun with Perl Subject: regex of the month (decade?) ^([Pp]([Oo][Ss][Tt])?[.\s]*[Oo]([Ff][Ff][Ii][Cc][Ee])?[.\s]*[Bb][Oo] [Xx])|[Pp][Oo]([Bb]|[Xx]|[Dd][Rr][Aa][Ww][Ee][Rr]|[Ss][Tt][Oo][Ff][Ff] [Ii][Cc][Ee]|[ ][Bb][Xx]|[Bb][Oo][Xx])|[Pp][/][Oo]|[Bb]([Xx]|[Oo][Xx]| [Uu][Zz][Oo][Nn])|[Aa]([Pp][Aa][Rr][Tt][Aa][Dd][Oo]|[Pp][Tt][Dd][Oo]) the challenge: itemize the stupidities. the case issue is only 1! i don't want to even post the 'spec' unless asked for it. i saw this on usenet today. enjoy!! uri -- Uri Guttman ------ [email protected] -------- http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org