perl.fwp
  Home FAQ Contact Sign in
perl.fwp only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
perl.fwp Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  RE: regex of the month (decade?)         


Author: Steven R. Stoll
Date: Jan 8, 2008 08:25

You're right. Mistook it for (.\s) for some reason. My description of .*
still stands however.

But the following should be:
(p(ost)?[.\s]*o(ffice)?[.\s]*box)

post(anynumberofperiodsorspacecharacterclassitems)office(anynumberofperiodso
rspacecharacterclassitems)box

p(anynumberofperiodsorspacecharacterclassitems)o(anynumberofperiodsorspacech
aracterclassitems)box

p(anynumberofperiodsorspacecharacterclassitems)office(anynumberofperiodsorsp
acecharacterclassitems)box

post(anynumberofperiodsorspacecharacterclassitems)o(anynumberofperiodsorspac
echaracterclassitems)box

Steve

-----Original Message-----
From: Keith Ivey [mailto:keith@iveys.org]
Sent: Tuesday, January 08, 2008 10:27 AM
To: Fun with Perl
Subject: Re: regex of the month (decade?)
Show full article (1.35Kb)
no comments
  RE: regex of the month (decade?)         


Author: Steven R. Stoll
Date: Jan 8, 2008 06:59

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)
Show full article (1.74Kb)
2 Comments
  regex of the month (decade?)         


Author: Uri Guttman
Date: Jan 7, 2008 14:06

^([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 ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
11 Comments