Re: matching date
- From: usenet@xxxxxxxxxxxxxxx
- Date: 28 Sep 2006 11:15:17 -0700
joez...@xxxxxxxxx wrote:
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.
Since you use "/" to delimit your pattern, Perl finds the next "/" and
thinks the pattern specification has ended. You can use another
character to delimit the match, but you must actually put "m" in front
of it, such as using bangs:
m!\d\d/[0-3]\d/\d\d!;
Or you can escape the embedded slashes:
/d\d\/[0-3]\d\/\d\d/;
Or you can use Regexp::Common from CPAN...
BTW, you didn't close your second-to-last character class.
--
David Filmer (http://DavidFilmer.com)
.
- References:
- matching date
- From: joez311
- matching date
- Prev by Date: Re: matching date
- Next by Date: Re: How to dynamically generate function name and call it?
- Previous by thread: Re: matching date
- Next by thread: Re: matching date
- Index(es):