regular expression for only alphabets code example
Example 1: only letters regex
/^[a-zA-Z]+$/g
Example 2: how to check if a string has only alphabets in javascript
if (!/[^a-zA-Z]/.test(word))
/^[a-zA-Z]+$/g
if (!/[^a-zA-Z]/.test(word))