only letters regex code example Example 1: only letters regex /^[a-zA-Z]+$/g Example 2: regex for number and letters let regex = /[^A-Za-z0-9]+/