REGEX for Range Validation | XM Community
Skip to main content

i have created at transposed multi punch matrix question and now i have to apply a validation to make sure that respondent should select more than 5 options but less than 10. How can i compare recode values using regex by referring to commas. I m thinking if 4-9 commas in recode value then it’s fine else we should show error message. How can i write regex to check 4-9 commas in recode values.

Use this regex: ^(\d+\,){4,9}\d+$

 


@Salim Use ^(?:?^,]+,){4,9}9^,]+$


Use this regex: ^(\d+\,){4,9}\d+$

 

Thanks, it worked.


@Salim Use ^(?:?^,]+,){4,9}9^,]+$

Thanks


Leave a Reply