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: 13:09
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






Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »
Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »