Auto-translation rules: How do I convert DD.MM.YYYY to MM/DD/YYYY
Thread poster: Marcel Machalski
Marcel Machalski
Marcel Machalski  Identity Verified
Germany
Local time: 10:00
Member (2022)
English to German
+ ...
May 24, 2023

Hi everyone,

I would like to convert dates from DD.MM.YYYY to MM/DD/YYYY using "Auto-translation rules". Example: 26.09.2018 becomes 09/26/2018. Any ideas on how to use Regex for this purpose?

Best regards,

Marcel


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 11:00
English to Russian
Regex May 25, 2023

Find what: (\d{1,2})\.(\d{1,2})\.(\d{2}\b|\d{4})
Replace with: $2/$1/$3

This regex captures different formats like these:
6.10.2022
06.10.2022
6.1.2022
6.10.22
06.10.22

If you always have the same date format DD.MM.YYYY only, you can use the below regex:
Find what: (\d{2})\.(\d{2})\.(\d{4})
Replace with: $2/$1/$3<
... See more
Find what: (\d{1,2})\.(\d{1,2})\.(\d{2}\b|\d{4})
Replace with: $2/$1/$3

This regex captures different formats like these:
6.10.2022
06.10.2022
6.1.2022
6.10.22
06.10.22

If you always have the same date format DD.MM.YYYY only, you can use the below regex:
Find what: (\d{2})\.(\d{2})\.(\d{4})
Replace with: $2/$1/$3


*First you type the left-side regex, then click Add. Then you type the right-side regex and click Add again for both regular expressions to get stored in the AT rule.

[Edited at 2023-05-25 01:33 GMT]
Collapse


Hans Lenting
Richard Varga
Grigori Gazarian
 
Marcel Machalski
Marcel Machalski  Identity Verified
Germany
Local time: 10:00
Member (2022)
English to German
+ ...
TOPIC STARTER
Wow! May 25, 2023

Hi Stepan,

Works like a charm, thank you! Your valuable post is very appreciated. However, translation results from DeepL (right column) are still not being auto-translated after confirmation. But no worries, maybe it's just another limitation of MemoQ.

Many thanks again,

Marcel


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 11:00
English to Russian
DeepL only provides target which is out of the auto-translate scope May 25, 2023

Marcel Machalski wrote:
translation results from DeepL (right column) are still not being auto-translated after confirmation
The AT rules engine only searches the source segments and allows you to transfer the conversion output into target regardless of confirmation. If you want to autoreplace dates in target, you should use Ctrl+H (Find and replace) instead of AT rules.


 


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


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

Auto-translation rules: How do I convert DD.MM.YYYY to MM/DD/YYYY






TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »