I want to use a lookbehind to protect data after a certain string. In this case, my client wants to protect names that are preceded by ‘mevrouw’ (= Mrs.).
I wrote a RegEx with a case sensitivity flag and a lookbehind section. However, it didn’t work, and I found the lookbehind seems to be the cause. This is my (simplified) RegEx:
(?-i)(?<=[mM]evrouw\s)[A-Z][a-z]+
This is my source segment before Protect:
- Ik ben mevrouw Smith en ik woon in Brussel.
Expected result:
- Ik ben mevrouw <TAG> en ik woon in Brussel.
Actual result after Protect:
- Ik ben mevrouw
I opened the SDLXLIFF in Notepad ++ and found that the content was really gone:
- <seg-source><mrk mtype="seg" mid="1">Ik ben mevrouw</mrk></seg-source>
Obviously, after Unprotect:
- Ik ben mevrouw
If I delete the lookbehind ((?-i)[mM]evrouw\s[A-Z][a-z]+), it works as expected: 'Mevrouw Smith' becomes a tag.
Is this a bug in the Data Protect Suite? Is there a fix or workaround?
Kind regards,
Ken