How to use Regex set up an unique survey ID? | XM Community
Skip to main content
Hello community!



I need to set up a validation of a Text entry box for a specific format. I ask participants to create their own unique survey ID for a longitude study. The requirements of the participant ID is below:



"Using last 4 digits of your mobile number PLUS initial of your mother’s maiden name"



Example: (mobile number: 04051314516, mother’s maiden name: Julie Smith) => 4516JS



I want to make sure people put exactly 4 digits plus 2 characters in to the text entry box. Anyone know how to do this?
Hello @GX123 ,



Try the below regex......



`^[0-9]{4}[A-Z]{2}$`
Hi Shashi,



Thank you for the reply.



As I am new to Qualtrics, could you please clarify how to insert the regex that you provided into the survey setting?
> @GX123 said:

> Hi Shashi,

>

> Thank you for the reply.

>

> As I am new to Qualtrics, could you please clarify how to insert the regex that you provided into the survey setting?



Go to custom validation -> in the drop down select "Matches regex" -> and in the text entry box paste the regex.



Resource
Thank you Shashi!! It works out well.

Leave a Reply