How to set-up a survey alert based on an exact text string from an open end response using RegEx | XM Community
Skip to main content
Solved

How to set-up a survey alert based on an exact text string from an open end response using RegEx

  • November 19, 2019
  • 2 replies
  • 30 views

Forum|alt.badge.img+3
As my question illustrates, I am a RegEx beginner. I am trying to set up a survey alert that triggers based on the presence of an exact text string, not the individual words. So in other words 'lower prices' but not just 'lower' or just 'prices'. Seems straight forward but my stab using the syntax below does not work. Thanks in advance for your assistance /(\\ |^)(lower prices|need more staff)(\\ |[[:punct:]]|$)/

Best answer by Greg_P

Not sure if it is bad form to answer your own question but I figured this out. The string below seems to work /(\\ |^)(^greg taco$)|(^allen burrito$)|(^john burger$)(\\ |[[:punct:]]|$)/

2 replies

Forum|alt.badge.img+3
  • Author
  • Answer
  • November 19, 2019
Not sure if it is bad form to answer your own question but I figured this out. The string below seems to work /(\\ |^)(^greg taco$)|(^allen burrito$)|(^john burger$)(\\ |[[:punct:]]|$)/

Forum|alt.badge.img+3
  • Author
  • November 21, 2019
I am pretty sure it is bad form to provide an incorrect answer. The above syntax only works if the comment includes those exact strings and nothing else which is generally not useful. The code below triggers alerts if the strings are present in the comment at all. /(\\ |^)(^.*greg taco.*$)|(^.*allen burrito.*$)|(^.*john burger.*$)(\\ |[[:punct:]]|$)/