|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Regular Expression - date parser problem
Hi all,
I use the following regular expression to parse a date: Code:
[0-9][0-9]{0,1}.{1}[0-9][0-9]{0,1}.{1}[0-9]{4}
This should validate all dates like this: 10.8.2002 9.12.1998 But if I enter this date: 14.0352001 or 14.3a2001 it validates it too, I don't know why! Any solution? Any parser proposition? Thanks a lot! ::tiago |
|
#2
|
|||
|
|||
|
In regex the period ( . ) means "any character". Try this:
Code:
[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{4}
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Regular Expression - date parser problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|