I need regexone that checks that the string contains only A-Z, A-Zand special characters, but not digitsie ( 0-9). Any help is appreciated.
regex
A-Z
special characters
not digits
0-9
You can try with this regex:
^[^\d]*$
And an example:
var str = 'test123'; if ( str.match(/^[^\d]*$/) ) { alert('matches'); }
Plain:
/^\D*$/
This means any number of characters other than numbers. Look in action ...
An alternative is to cancel the test. Just check if a digit is present using the trivial:
/\d/
... and if that matches, your line will fail.
: ^[A-Za-z.,!@#$%^&*()=+_-]+$.
^[A-Za-z.,!@#$%^&*()=+_-]+$
^ $ , .
^
$
:
var re = /^[a-zA-Z!#$%]+$/;
-