I am trying to change the conditional visibility of a field based on the answer to another. It is a multiple select questions with domain options of (IP, PH, DH, M, EM, and VM). I want to show Questions02 when IP or DH or M are selected from Question01. I am currently using regex(${Question01}, '(IP|DH|M)') but this will also be true if you select EM or VM in Question01. How do I keep it true if M is selected but not EM or VM?
Solved! Go to Solution.
You don't need regex here. This will do what you are wanting:
selected(${Question01},'IP') or selected(${Question01},'DH') or selected(${Question01},'M')
Check out https://regex101.com, it is an excellent resource for learning about and testing out regex statements.
Since you want to match the full text, not partial, you can include "^" and "$" for start and end of the string, respectively. You can see here that EM and VM are not included in the matches.