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

Lenart  Identity Verified
Luxembourg
Local time: 21: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
Monaco
Local time: 21: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: 21: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: 21: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







BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

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

More info »



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