On Jan 7, 2008 5:06 PM, Uri Guttman <[EMAIL PROTECTED]> wrote: > > ^([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 > >
I don't even want to know what that's supposed to do. First, and most obviously, that should use /i. That gives us: ^(p(ost)?[.\s]*o(ffice)?[.\s]*box)|po(b|x|drawer|stoffice|\sbx|box)|p/o|b(x|ox|uzon)|a(partado|ptdo) Last I checked, '.' matches \s. Oh, and '/' uis a pretty important character, and should really be escaped. ^(p(ost)?.*o(ffice)?.*box)|po(b|x|drawer|stoffice|\sbx|box)|p\/o|b(x|ox|uzon)|a(partado|ptdo) Unless I'm horribly mistaken, that can be simplified incredibly to ^(p(ost)?.*o(ffice)?.*box)|po(b|x|drawer|stoffice|\sbx)|p\/o|b(o?x|uzon)|a(partado|ptdo) or ^(p(ost)?.*o(ffice)?.*)(b|x|drawer)|p\/o|b(o?x|uzon)|a(partado|ptdo) In total, I count 9 errors and 213 characters removed. Though, I can't count, so that may be wrong. Did I miss anything?