Re: regex of the month (decade?)
Keith Ivey <[email protected]> Tue, 08 Jan 2008 10:26:40 -0500
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
Stoll, Steven R. wrote: > (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 '[.\s]*' matches any number of periods or whitespace characters, since '.' is not special inside a character class. It's not the same as '.*'. Also, even if '.' were special, '\s' matches newline along with other whitespace characters. -- Keith C. Ivey <[email protected]> Washington, DC