Looking for regex to match ANY string that isn't all numeric | XM Community
Solved

Looking for regex to match ANY string that isn't all numeric

  • 16 November 2021
  • 2 replies
  • 11163 views

Hello,
I'm using the survey flow logic and I want to branch people to select questions if they've input any type of non numeric string into a form field response.
It appears the only way to do this is by checking whether their input matches the regex code for any non numeric string.
E.g. if they enter
1
100
1000000
They would not match the regex.
If they enter
$100
One hundred
$1k
They would match the regex.
I've tried just about every variation of strings, non numeric, character match regex and none of them seem to accomplish this. Is there any suggestion for a regex to do this?
The survey flow logic states that

"If question # matches regex ^[]$" 
show block.
Thank you!

icon

Best answer by TomG 16 November 2021, 12:37

View original

2 replies

Userlevel 7
Badge +27

Try [^0-9]. It should match any string that has non-numeric characters.

Thank you so much, Tom! I tried so many codes similar to that but not that exactly. That worked perfectly.

Leave a Reply