Regular expressions are one of the most powerful tools in a programmer’s arsenal.
If you have ever attempted to create your own regular expression to match only alphabets and spaces, you might find this article useful.
/^[a-zA-Z ]*$/
Matches:
- ABC D
- ABCD
- ABC d
- ABC
Non-matches:
- 123
- !@#$
See Also:
- Regular Expression To Check Non-digit Characters
- Regular Expression To Match Non-Alphanumeric Characters
- Alphanumeric Regular Expression
- Special Characters Regular Expression