Regex for finding dates
top of page

Regex for finding dates


Here's a simple Regex to find dates in different formats:

[0-3]?[0-9]/[0-3]?[0-9]/(?:[0-9]{2})?[0-9]{2}

So if we have a text file like this one:

. . . and we run the Regex search this way in PowerGrep

We get these results:

Thanks to Lokesh Gupta for posting this regular expression at http://howtodoinjava.com/regex/java-regex-date-format-validation/


bottom of page