SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL MultiTerm
SDL Passolo
SDL Speech to Text
SDL Managed Translation - Enterprise
SDL MultiTrans
SDL TMS
SDL WorldServer
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL XPP
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Language Developers
Tridion Developers
Tridion Docs Developers
Xopus Developers
Community Help
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
SDL Training & Certification
Style Guides
Language Technology Partner Group
SDL Academic Partners
SDL Approved Trainers
SDL Enterprise Technology Partners
XyUser Group
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 XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
What's New in SDL
Detecting language please wait for.......
Hi,
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):
Target:
However, when I confirm a segment with this pattern in, I get this error message:
Can anyone see what I'm doing wrong here?
Thanks,
Hayley
OK, if you also need to check the character before the parentheses, then this source regex should work:
([A-Z])(\(\W\))
with the target regex you mentioned:
$1$2
Can't test it now, but I think that it should work if you change
the source regex to:
[A-Z]\((\W)\)
and the target regex to:
$1
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…).
Hi Jésus,
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:
Source: ([A-Z]\([\+-]\))
Target: $0
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:
[A-Z]\([+-]\)
and don't use a grouped regex at all.