regular expression for validation not working
- by Camran
I have a "description textarea" inside a form where user may enter a description for an item.
This is validated with javascript before the form beeing submitted.
One of the validation-steps is this:
else if (!fld.value.match(desExp)){
And desExp:
var desExp = /^\s*(\w[^\w]*){3}.*$/gm;
Now my problem, this works fine on all cases except for descriptions where the description BEGINS with a special character of the swedish language (å, ä, ö).
This wont work:
åäö hello world
But this will:
hello world åäö
Any fixes?
Thanks