S
Syed Ali
Hello,
I am trying to create a regexp to express non letters and space.
I tried using:
var myreg = new RegExp ("[^\\sA-Za-z]");
However, it is not working.
Basically I want to allow only words with letters in a textfield,
space is ok, but no special characters such as $%^ or numbers such as
1234.
If I use: var myreg = new RegExp ("[^A-Za-z]");
then "Hello" is ok, but not "Hello There" because there is a space
between Hello and There. I want to allow:
Hello
Hello There
Hello there how are you
and I do not want to allow any special characters such as #$%^ or
numbers.
Thank you!
I am trying to create a regexp to express non letters and space.
I tried using:
var myreg = new RegExp ("[^\\sA-Za-z]");
However, it is not working.
Basically I want to allow only words with letters in a textfield,
space is ok, but no special characters such as $%^ or numbers such as
1234.
If I use: var myreg = new RegExp ("[^A-Za-z]");
then "Hello" is ok, but not "Hello There" because there is a space
between Hello and There. I want to allow:
Hello
Hello There
Hello there how are you
and I do not want to allow any special characters such as #$%^ or
numbers.
Thank you!