Date replace in TextWrangler

Hi Everyone,

I’m quite new to the command line and script editing environment, so I know this is a really easy question. But I’m just staring at this trying to figure out what’s wrong with my grep command.

I’m exporting my filemaker pro database into a mysql database, only all the dates in FMP are in MMDDYY or MMDDYYYY format, and mysql has to be in YYYYMMDD as you know.

So in Textwrangler I’m doing a search and replace using grep. Here’s my search string.

[0-9][0-9]?>/[0-9][0-9]?>/[0-9][0-9]?[0-9]?[0-9]?>


and I’m replacing it with:

3/1/2

It tells me the pattern is not found in the document. Only I know it is.

Any help greatly appreciated in advance.
Thanks,
emily

This isn’t the forum for posting questions like this since it has nothing to do with scripting. That said, when GREP searching for a pattern MMDDYY to convert to YYYYMMDD, try this:

Search: ([0-9][0-9][0-9][0-9])([0-9][0-9])
Replace: 2021

This will make all your years into 21st century dates. If you need 20th century, then replace with:

Replace: 1921

Jon