I’m looking for a regexp to see if a string contains any special characters, numbers or anything else but letters.
For example I have a string "This is a 5 string #". Now I would need a regexp to see if this string contains any special characters like # or numbers like 5.
I’m not familiar with using regexp approaches.
you can use
.test()methodthis will find if some symbols different from a-z and A-Z are inside the string. Note also that this regexp won’t accept accented letters. in that case you will need a more refined regexp like
see a unicode table to choose what symbols are acceptable in your string
http://unicode.org/charts/