Modify

Opened 16 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



Attachments (0)

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.