java - extract start and end date with regex group -
i have service period mentioned
may 01-15 and need extract start , end date as
group 1 : may 01 group 2 : may 15 is possible???
it possible.
this expression
@(jan|feb|may) (\d{1,2})-(\d{1,2})@is gives following array
array ( [0] => may 01-15 [1] => may [2] => 01 [3] => 15 ) you should expand first parenthesis months need/want.
Comments
Post a Comment