I have created a regex to only allow characters a-z and A-z. For some reason, the ^ is the only special character that is currently still allowed to be entered as an input. I am not sure why this is happening or how to stop this one character from being allowed to be entered as an input.
console.log( "hello - ^ & world".replace(/[^a-zA-z]/g, '') );
>Solution :
A-z is much wider range than A-Z. It includes A-Z, ton of special chars and a-z.
You made a typo (last z should be uppercase), and full regex should look like
/[^a-zA-Z]/g