With
regexMatch
expressioon manager function : we can control number of word.
Proposed regexp is
www.limesurvey.org/manual/Using_regular_...essions#Word_count/^
[-\w]+(?:\W+[-\w]+){0,199}\W*$/
(this allow word and -)
Code:
is_empty(this.NAOK) or regexMatch('/^[-\w]+(?:\W+[-\w]+){5,5}\W*$/', trim(this.NAOK))
6 words needed
It work for non utf8,
but not for UF8 caracter : aaaéaa is 2 word.
I search for regexp to replace \W an\w, but i don't find the good way …
Did someone already find a solution ?
I want javascript control (more easy … the count in screenshot can be easily improved) , but i want PHP control too …
Thanks …
Test survey attached
PS : maybe a solution can be count ([\s|!|\.|\?|,]) : word are number of space +1