Re: matching date




joez311@xxxxxxxxx wrote:
Hi,
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.

Well yes the unescaped / would be a problem if you are also using it as
your pattern demiliter.

As would the missing ]

And I somehow doubut you really want to allow the first character to be
a comma.

Fix all that and your pattern will still match 19/39/06

So why not simply m{\d\d/\d\d/\d\d}?

Fundamentally though you have an insummountable problem trying to match
a date only when it's fomatted mm/dd/yy since there are strings like
"01/02/03" that look like valid dates in yy/mm/dd or dd/mm/yy format
too.

Perhaps if we knew what you really wanted to do...

.



Relevant Pages

  • Re: Strange Form Behavior
    ... be caused by a unexpected keystroke event. ... The pattern they move from field to field could be unique to this company, ... > for 4-5 times and then any fix that appears to fix it will last for about ... > identical everytime too - it is a simple receipt entry form. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Leaning Forward While Juggling
    ... forward at the hips when I juggle. ... I found that I could keep the pattern steady, ... To fix it, I took the same approach as fixing the rotating problem. ...
    (rec.juggling)
  • Re: File Names in Windows Explorer Changed Color
    ... pattern, except that the names of files created within the ... Re-booting didn't change anything. ... Any idea what caused this and how to fix it? ...
    (microsoft.public.windowsxp.general)
  • Re: OO in Tcl (goodbye tcl)
    ... :"get and install Tcl/Tk, ... pattern, there is ... :something to fix. ... coding the same algorithms as others, or they can download pre-coded solutions. ...
    (comp.lang.tcl)
  • Re: "the operation failed" error
    ... > happened since I installed 3.7.1, and I have tried uninstalling it, and ... > the only fix is to reboot, ... When you have some data look for the pattern. ...
    (microsoft.public.pocketpc.activesync)