Regex code for a word that is repeating exactly twice in a segment
Thread poster: Lenart

Lenart  Identity Verified
Luxembourg
Local time: 15:05
Jul 7

Hello,

While translating I have to respect a following rule:
If „EU:“ repeats exactly twice in the source, there must be a word „sodbi“ in the target.
I tried with:
Regex source: (EU:){2}
Regex target: sodbi
Condition : if source matches but not the target

However, it does not work. Does anybody have an idea where is the problem?


 

Daniel Frisano
Switzerland
Local time: 15:05
Member (2008)
English to Italian
+ ...
Question Jul 7

Are the two occurrences of "EU" seprated by a space? Is it "EUEU" or "EU EU"?

 

Anthony Rudd

Local time: 15:05
Regex for duplicated word Jul 7

Your regex checks for EU:EU:
A more general regex (with one whitespace between the two terms) would be EU:\sEU:
or (with zero or more whitespaces between the two terms) would be EU:\s*EU:
and to match with word boundaries \bEU:\s*EU:\b


 

Lenart  Identity Verified
Luxembourg
Local time: 15:05
TOPIC STARTER
thank you! Jul 8



[Edited at 2018-07-08 08:59 GMT]


 


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


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

Regex code for a word that is repeating exactly twice in a segment

Advanced search







Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »
SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running and helps experienced users make the most of the powerful features.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search