Regex in MemoQ... grief
Thread poster: Shawn Connelly
Sep 10, 2021

Hello all,

I am hoping someone can help me figure out why my regex isn't working in MemoQ, even though I tested it to work here: https://www.regextester.com/

My goal is to find segments include word1 but do not include word2.

Here is my regex:
^(?!.*(word2)).*(word1).*

I also tested it with the MemoQ regex assistant and it doesn't work.

... See more
Hello all,

I am hoping someone can help me figure out why my regex isn't working in MemoQ, even though I tested it to work here: https://www.regextester.com/

My goal is to find segments include word1 but do not include word2.

Here is my regex:
^(?!.*(word2)).*(word1).*

I also tested it with the MemoQ regex assistant and it doesn't work.

What am I doing wrong?

Thank you
Collapse


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 01:49
English to Russian
Switch between plain-text and regex search Sep 11, 2021

I have just tried your regex and it works fine for me.
Probably, you forgot to enable the regex search mode.
2021-09-11_180528
Also, you should keep in mind that your regex captures words that may constitute a part of another longer word.
For example, you have a phrase like
"long-term employment"
and you use a regex like
^(?!.*(employ)).*(term).*
The word 'employment' includes the word 'employ' that must be excluded according to your regex. The regex won't work in this case because the condition of your regex is not met.
If you want to strictly limit the excluded and/or included words, you should add \b around each word1 and word2 to read as follows:
^(?!.*(\bword2\b)).*(\bword1\b).*

[Edited at 2021-09-11 15:37 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 in MemoQ... grief






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