Re: matching date
- From: "it_says_BALLS_on_your forehead" <simon.chao@xxxxxxx>
- Date: 28 Sep 2006 12:26:23 -0700
Dr.Ruud wrote:
joez311@xxxxxxxxx schreef:
Can someone help me out with the following pattern match? I want to
match on the date went its formated like mm/dd/yy. I was trying:
/[0,1][0-9]/[0-3][0-9]/[0-9[0-9]/
but my match doesn't seam to work as expected. I think its because of
the / used to split the feilds. Could some one show me the correct way
to pattern match on this?
Thanks,
Zim
I see a comma that probably shouldn't be there, and a missing "]", and
unescaped slashes, which leads to:
m~[01][0-9]/[0-3][0-9]/[0-9][0-9]~
one issue with the OP's regex (even after it's been "corrected") is
that it matches months 13 - 19, and days 32 - 39 (and also day 31 for
months that don't have that particular day).
Check out Regexp::Common
http://search.cpan.org/search?module=Regexp::Common
.
- References:
- matching date
- From: joez311
- Re: matching date
- From: Dr.Ruud
- matching date
- Prev by Date: Re: FTP from Perl script on Windows
- Next by Date: Re: Limit FORM mailer submissions to 5 on website, then pause until reviewed by webmaster
- Previous by thread: Re: matching date
- Next by thread: Re: matching date
- Index(es):
Relevant Pages
|