SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL Speech to Text
SDL Managed Translation - Enterprise
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Tridion Docs Developers
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
SDL Training & Certification
Language Technology Partner Group
SDL Academic Partners
SDL Approved Trainers
SDL Enterprise Technology Partners
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic SDL Tridion Docs User Group
SDL Tridion UK Meetup
SDL Tridion User Group New England
SDL Tridion West Coast User Group
SDL WorldServer User Group
Tridion Docs Europe & APAC User Group
Tridion User Group Benelux
Tridion User Group Ohio Valley
SDL MultiTerm Ideas
SDL Passolo Ideas
SDL Trados GroupShare Ideas
SDL Trados Studio Ideas
SDL Machine Translation Cloud Ideas
SDL Machine Translation Edge Ideas
SDL Language Cloud TMS Ideas
SDL Language Cloud Terminology Ideas
SDL Language Cloud Online Editor Ideas
SDL Managed Translation - Enterprise Ideas
SDL TMS Ideas
SDL WorldServer Ideas
SDL Tridion Docs Ideas
SDL Tridion Sites Ideas
SDL LiveContent S1000D Ideas
SDL Contenta S1000D
SDL XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
What's New in SDL
Detecting language please wait for.......
I have a project containing many occurrences of this type of pattern (any letter A-Z, and a +/- sign in brackets; with multiple pairs of this pattern per segment):
" ... between A(+) and B(-) and between F(+) and C(-)"
I'm using Studio 2019 and I've tried to set up a Regex check in the QA checker, using a Grouped Search Expression (source matches but not target), but I get an error message and don't know why.
Here's what I've tried:
Source (all of these patterns work when I test them in the search box of the Community Advanced Display Filter and in a third-party regex checker):
However, when I confirm a segment with this pattern in, I get this error message:
Can anyone see what I'm doing wrong here?
OK, if you also need to check the character before the parentheses, then this source regex should work:
with the target regex you mentioned:
Can't test it now, but I think that it should work if you change
the source regex to:
and the target regex to:
The source regex still needs the unescaped parentheses to set the group and then backreference it with number $1 in the target regex (although $0 might work as well…).
Thanks for the quick reply. I tried your suggestion, and it worked in part: it correctly flags up a missing (+) or (-) in the target. However, it doesn't spot an incorrect letter, because (if I understand correctly) the $1 only captures and checks for the part in brackets.
I thought $0 meant "capture all of the source expression", so I tried putting that in the target box, but that flagged up every matching pattern in the source as "missing" in the target, even though they were all present and correct.I then tried ([A-Z])\((\W)\) as the source, and $1$2 as the target, but that did the same: flagged everything as missing even when it was present.
I suppose I could set up a second, separate, grouped Regex to check single capital letters, but if there's something that can combine the two, that would be better!
So I'm still searching...
Thanks again for your help! For info/for anyone else reading this, I posted the same question in another forum, and somebody there suggested an alternative version, which also works:
Yeah, there are usually several regexes.
I even think your latest regex can be simplified to
([A-Z]\([+-]\)) with the same target regex,
and even to:
and don't use a grouped regex at all.