QA Checker 3.0 > regex code question
Thread poster: Lenart
Lenart
Lenart  Identity Verified
Luxembourg
Local time: 18:36
Mar 12, 2020

Hello,

I am looking for a regex code that would signal me when the only text in the source is a date (date and nothing but the date). The format of the date is always this: 26 mars 2020 followed by a tag.

Any ideas what that piece of code would look like?

thank you and much love and health to all of you!!


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 20:36
English to Russian
Try this Mar 12, 2020

1. This one is for "XX anymonth XXXX" or "X anymonth XXXX"
^\d{1,2}\s(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)\s\d{4}$
If you always have 2 chars for date (including 01, 02, 03, etc.), then remove 1, from the ^\d{1,2} group to read as ^\d{2}

Which tag? I can't figure out a situation with one trailing tag. Formatting (like bold or italics) gives a pair of tags. 'Field' text (like automatic page numbering) or tabs give no tag
... See more
1. This one is for "XX anymonth XXXX" or "X anymonth XXXX"
^\d{1,2}\s(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)\s\d{4}$
If you always have 2 chars for date (including 01, 02, 03, etc.), then remove 1, from the ^\d{1,2} group to read as ^\d{2}

Which tag? I can't figure out a situation with one trailing tag. Formatting (like bold or italics) gives a pair of tags. 'Field' text (like automatic page numbering) or tabs give no tag at all...

2. Try this for dates with any tag(s) at the end:
^\d{1,2}\s(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)\s\d{4}<.*?>$
This portion <.*?> includes both paired and unpaired tags.

3. Try this for dates with an unpaired tag at the end:
^\d{1,2}\s(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)\s\d{4}<.*?/>$

[Edited at 2020-03-13 10:50 GMT]
Collapse


 
Lenart
Lenart  Identity Verified
Luxembourg
Local time: 18:36
TOPIC STARTER
Stepan, thank you for your fast solution! Mar 13, 2020

Stepan, thank you for your fast solution!

 


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


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

QA Checker 3.0 > regex code question







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 »
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 »