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

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

  • 19 November 2019
  • 2 replies
  • 24 views

Userlevel 1
Badge +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:]]|$)/
icon

Best answer by Greg_P 19 November 2019, 21:44

View original

2 replies

Userlevel 1
Badge +3
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:]]|$)/
Userlevel 1
Badge +3
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:]]|$)/

Leave a Reply