I'm trying to validate user input to return valid if and only if a input string is between 1-10 chars in length and contains no whitespace or non a-z chars.
I'm using this regular expression
var re = /(\S[a-z]){1,10}/;
but this returns true when numbers are input. And if white space if input e.g
1
returns valid.
a a
returns valid.
I want to restrict the input to only between l-10(amount) of letters(lowercase) What I have so far;