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: 17:49
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: 18:49
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: 17:49
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: 18:49
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






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »