Allow 4 numbers in the text box | XM Community
Skip to main content
Question

Allow 4 numbers in the text box

  • February 27, 2021
  • 1 reply
  • 124 views

Forum|alt.badge.img+1

Hi friends,
I'd like to ask participants to provide the last four digits of their mobile phone numbers.
For example: Phone number: 0938 42 62 42 => The last four digits: 6242
I choose Text => Content Valiadation => Number. However, I dont' want some situations such as:

  • Put only 1, 2, or 3 numbers. For example: 6 or 62 or 624

  • Space. For example: 62 42

  • Include other characters (. , - ;). For example: 62.42 or 62-42

This is anonymous code which matchs their responses overtime, therefore, it should be correct to use logic display in the later surveys. What should I do to avoid these cases?

Thank you!

1 reply

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • February 27, 2021

Matches regex:

^\\d{4}$