Regex with dates
Thread poster: Reed James
Reed James
Reed James
Chile
Local time: 08:19
Member (2005)
Spanish to English
Apr 13, 2019

I would like to know the best way to check date formats. Sometimes I have to convert US date format to UK date format. Can this be done with a regular expression in the search and replace dialogue?

 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 11:19
Member (2014)
Japanese to English
If even humans struggle... Apr 13, 2019

Reed James wrote:
Sometimes I have to convert US date format to UK date format.

I think the issue is that a date like "02/02/02" is ambiguous, but valid under either UK dd/mm/yy and US mm/dd/yy conventions. If even you can't tell which is which by looking at it, how can the regex? You might say "Well, that's unlikely to happen very often", but it's those edge cases that will get ya if you do a bulk find and replace.

Problems like this explain why the ISO 8601 format (yyyy-mm-dd) exists.

Regards,
Dan


 
Jean Lachaud
Jean Lachaud  Identity Verified
United States
Local time: 07:19
English to French
+ ...
Wordfast 5.8 Online Help says: Apr 13, 2019

"Note: Select Use Regex to search on regular expressions or wild card characters.", which should answer your question.

 
Reed James
Reed James
Chile
Local time: 08:19
Member (2005)
Spanish to English
TOPIC STARTER
How about the months written out? Apr 13, 2019

Usually what happens is that I will see 8 US date such as January 2, 1955 and I want to change into 22 January 1955. I don't necessarily need to in the find and replace dialog placed out. All I need to do is to find all of the months written out instead of doing an individual search for each month (January, February, March…) which is tedious and unnecessary.

 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Regex with dates







Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »