String is alpha
Checks if a string contains only alpha characters.
- Use
RegExp.prototype.test()
to check if the given string matches against the alphabetic regexp pattern.
const isAlpha = str => /^[a-zA-Z]*$/.test(str);
Example
Last updated on February 13, 2023