regex for alphabets and numbers only code example
Example 1: regex for number and letters
let regex = /[^A-Za-z0-9]+/
Example 2: regex notation for alphabet characters
/^[A-Z]+$/i
/^[A-Za-z]+$/
let regex = /[^A-Za-z0-9]+/
/^[A-Z]+$/i
/^[A-Za-z]+$/