In the documentation regarding QA Checker "Grouped search expression - report if source matches but not target," there is a note stating the following:
Note: The target RegEx cannot contain any special escape characters and will act exactly as pattern for replace function of .NET RegEx implementation.
Could someone tell me where "pattern for replace function of .NET RegEx implementation" is specifically documented?
I see that the documentation has examples such as
source - (\b\d+\b)target - \b$1\b
which seems to imply that "\b" is accepted. What other escapes can be used?
Thanks in advance.
Hi takayuki Osato
The "Grouped Search" expression currently works by supporting the use of a back reference only. So if you wanted your expression to work you would use this:
RegEx source: (?<![0-9])([2-9][\d]+)(?![0-9])
RegEx target: $1
Anything else is taken literally. There is a change to this due in the next CU that will allow any regex construct to be used as regex, but for now you can only use the back reference.
I would also note that your expression excludes numbers beginning with "1", so these would not be found for example:
There are 11230 files
There are 149 files
But perhaps that's ok for your target text? Just in case maybe something like this might be better?
It's great to know that this limitation will be lifted in the next CU.
And, thanks for pointing out the mistake in my source regex! I will definitely change it.