08-20-2008 8:31 PM
I know this is not the right forum, but the regex is part of PHP page i am using one of WebDynpro screens.
I am using the following RegEx for finding sub matches of a date. But the third sub match is giving only 2 characters.
Please find Regex i am using
(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}
and using date as 12/12/2008 , but in sub matches i am getting the values as 12 12 20
"text-116 = (0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}
data : regex type ref to cl_abap_regex,
concatenate text-116 space into p_regex.
condense p_regex.
create object regex
exporting
pattern = p_regex
ignore_case = ''.
* For REGEX match
matcher = cl_abap_matcher=>create(
pattern = p_regex
ignore_case = ' '
table = i_dates ).
lt_result = matcher->find_all( ).
if lines( lt_result ) gt 0.
Any info?
a®
08-20-2008 10:23 PM
hi! try this
\b(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)?[0-9]{2})\b
regards, anton
08-20-2008 10:23 PM
hi! try this
\b(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)?[0-9]{2})\b
regards, anton
08-21-2008 4:24 PM
08-21-2008 9:18 PM