I have string for example: 06.07.2010 (tor.)
I would like to extract only 06.07.2010 using a regex, but the following is not working correctly:
^([0-9]{1,2}).([0-9]{1,2}).([0-9]{4,4})$
^([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$
Can someone tell me what is wrong here?
It’s the
$at the end. It means there can’t be any characters after the year digits – in other words, the RE has to match the entire string.You probably want this instead: