Re: matching date



joez311@xxxxxxxxx <joez311@xxxxxxxxx> wrote:

I want to
match on the date went its formated like mm/dd/yy.


print "$_ looks like a date\n" if m#^\d\d/\d\d/\d\d$#; # untested


I was trying:
/[0,1][0-9]/[0-3][0-9]/[0-9[0-9]/
^^^^^ ^^ where is the closing square bracket?
^^^^^ matches any one of *three* characters, it will match a comma...


but my match doesn't seam to work as expected. I think its because of
the / used to split the feilds.


Either put a backslash in front of the slashes, or use an alternate
delimiter for the match operator.


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.



Relevant Pages