The message may contain a date in the format dd.mm.yyyy. In the specified format, dd is an integer from 1 to 31, mm is an integer from 1 to 12, and yyyy is an integer from 1900 to 2012 (if some part of the format is broken, then this substring is dates are not considered). Find all dates that relate to the current year.
I got the following regular expression:
[1-31]\.[1-12]\.[1900-2012] I can not understand why the dates corresponding to this format are not recognized.
What should I fix? What is wrong here?
[1-31]means 1 to 3, i.e. 1, 2, 3 last 1 is ignored as it is already in the set. in any case, all that in square brackets means only one character. for example, from 1 to 31, the expression will be:(0?[1-9]|[12][0-9]|3[01])\.Note the `\` before the stop will mean any character - Mike