‎2008 May 06 9:30 PM
I am using the following pattern of RegEx for validating the date.
but it not giving proper result for Feb 31 date
p_regex = ' (0?[1-9]|[0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9] '
create object regex
exporting
pattern = p_regex
ignore_case = ''.
matcher = cl_abap_matcher=>create(
pattern = p_regex
ignore_case = ' '
table = i_files ).
Any Info?
a®
‎2008 May 07 2:29 PM
Feb has only 28 days or 29(Leap year).
Might be this is the reason ...
‎2008 May 07 2:36 PM
Srinivas,
You didn't understand my question. in my question i mentioned that i am validating dates. ie i need to validate date from a file that contains dates say for example Feb 31
a®
‎2008 May 07 3:14 PM
‎2008 May 07 3:57 PM
Solved.
My RegEx was wrong. The RegEx mentioned in my question is will work fine with dd/mm/yyyy format. But date format is mm/dd/yyyy
Corect RegEx
' (0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2} '
a®