Restricting text response with exactly 8 to 10 words while collecting data

Hi @GVitale,

Adding to what @wroos has advised, you could also do it by slightly editing the code that has been outlined in the support article Restricting text responses with regular expressions.

image

To restrict the words to exactly 8 words:

regex(., '^\W*(\w+\b\W*){8}$')

To restrict the words to exactly 10 words:

regex(., '^\W*(\w+\b\W*){10}$')

Have a great day!

1 Like