Regex QA check - Grouped Search Expressions

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):

  • [A-Z]\(\W\)
  • [A-Z]\(.\)
  • [A-Z]\([\+-]\)

Target:

  • $0

However, when I confirm a segment with this pattern in, I get this error message:

Error dialog box in Trados Studio with a red X icon indicating a parsing error for the regex pattern 'A(+)' and a message 'Quantifier x,y following nothing.' with options for Knowledge Base and Community.

Can anyone see what I'm doing wrong here?

Thanks,

Hayley



Generated Image Alt-Text
[edited by: Trados AI at 4:33 AM (GMT 0) on 5 Mar 2024]
emoji
Parents Reply
  • 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...

    Hayley

Children