validator regex

validator regex

I am attempting to limit the entry of values into a 1 character textbox. Trying to use regex. The way I am doing it does nothing at all. For example, I can enter a G into the box and it doesn't care. Cannot find any examples online since it seems most people want to allow a-z so all the examples show a-z. No variety at all.

code:

data-bvalidator="^[YyNn]"