Sensitive Data Policy: RegEx with Positive LookBehind | XM Community
Question

Sensitive Data Policy: RegEx with Positive LookBehind

  • 14 July 2020
  • 0 replies
  • 12 views

Userlevel 2
Badge +5

We want to set up a Custom Topic for Sensitive Data Policy. We have strings like "I like the work of Mr Smith, and my favourite employee is Mrs. Miller", and want the names to be anonymized. We are searching for addresses like Mr or Mrs. but want to be deleted only the word afterwards: "I like the work of Mr *********, and my favourite employee is Mrs. *********". We would achieve our goal with a RegEx pattern like

(?<=\\b(Mr(\\.?)|Mrs(\\.?))([ ,:;?!)]))(((\\s(\\w|-|/)+)|(\\w|-|/)+)\\s*(\\w|-|/)*)

But Qualtrics doesn't allow the positive lookbehind
(?<=expr)
, so omitting that part, we receive "I like the work of *********, and my favourite employee is *********". Any idea how to save the addresses, but delete the personal information?


0 replies

Be the first to reply!

Leave a Reply