in reply to Regex question
(?:[1-31]) #day, 1 to 31
That's not doing what you think it is. What you have there is functionally equivalent to [123] (or [1-3]).
A simple replacement would be \d+ (or, perhaps, \d\d?). But that also matches many invalid dates.
Update: Fletch fills in details that I was too lazy to :-)
See the Copyright notice on my home node.
"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex question
by Fletch (Bishop) on Mar 22, 2007 at 14:47 UTC | |
by johngg (Canon) on Mar 22, 2007 at 15:17 UTC |