regex only alphabets code example Example 1: only letters regex /^[a-zA-Z]+$/g Example 2: regex notation for alphabet characters /^[A-Z]+$/i /^[A-Za-z]+$/