Regex for numbers

this is accepting negative numbers yet I want only 1-5, can you help?

Welcome to the ODK forum, @pirakiza! We're glad you're here. When you get a chance, please introduce yourself on this forum thread. I'd also encourage you to add a picture as your avatar because it helps build community!

Do you want you answer to be limited to 1,2,3,4, or 5? You can use the following:

+---------+------+----------------+-------------+----------------------------+
|  type   | name |     label      | constraint  |     constraint_message     |
+---------+------+----------------+-------------+----------------------------+
| integer | q1   | Input a number | .>0 and .<6 | number must be >=1 and <=5 |
+---------+------+----------------+-------------+----------------------------+
1 Like