I’m using LiveValidation (http://livevalidation.com/) to validate a form on my site in the client-side part.
However i’m having problems using the regular expressions:
the example on the website is not very clear and i’m trying to validate a field where i don’t want to reject numbers with this:
var f1a = new LiveValidation('nome');
f1a.add( Validate.Format, { pattern: /[a-zA-Z]/i } );
or at least all non digit characters:
[^0-9] ???
are my regular expressions wrong?
or am i using wrongly the live validation with reg exp?
Thanks!
This regex matches input that is all alphabets.
The + is necessary for it to match multiple characters. Without it, the regex matches the first character and stops.
I recommend this website. It has a lot of samples and you can test the regex.
the
iin the regex is theignoreCaseflag. When specified, matches are made irrespective of case.