Opened 17 years ago

Closed 15 years ago

#32 closed Support Requests (Invalid)

regex problem

Reported by: ppfort Owned by: John Maddock
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

I have the following problem with regex.
I want to check a date format. The possible formats 
are dd.mm.yy or dd.mm.20yy

My regular expression is:
(([0]?[1-9]|[1-2][0-9]|3[0-1])[.]([0]?[1-9]|1[0-2])[.]
(20[0-9]{2}|[0-9]{2}))

regex_match fails, when i try 01.02.200



Change History (1)

comment:1 Changed 15 years ago by John Maddock

Status: assignedclosed
Logged In: YES 
user_id=14804

Look more closely: your expression should fail in that case!

It should match 01.02.20 or 01.02.2000 but not 01.02.200

John Maddock
Note: See TracTickets for help on using tickets.