Regex/wildcard search for dates with 2-digit and 4-digit years
I have been working with the attached code to see if I can get it to search and format dates in Word. I am trying to get it to search for a variety of formats, and having some success with a wildcard search. But I’m stuck on searching the format ‘9/25/2014’.
The wildcard expression I’m using for this, "([0-9]{1,2})(/)([0-9]{1,2})(/)([0-9]{2})", finds both dates with 2- and 4-digit years. The code highlights '9/25/20’ and ignores the ‘14’ (as it should because of the {2}), but I want to find a way to have it search ONLY for dates with 2-digit years, instead of reading only the first 2 digits of 4-digit years. Been trying other wildcard switches but nothing achieves this specific search.
Can I get some help? Code is in the attached.
|