QA Checker 3.0 > regex code question
Autor vlákna: Lenart
Lenart
Lenart  Identity Verified
Lucembursko
Local time: 08:19
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
Ruská federace
Local time: 10:19
angličtina -> ruština
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
Lucembursko
Local time: 08:19
AUTOR TÉMATU
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







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