Reputation: 4450
I'm looking for a regex that will only allow characters e, b, z, l to be typed in the user input.
I believe this is wrong ? :
/[ebzl]*/i
I know I need to use a class but I don't know how and couldn't find any relevant tutorials for the above online.
$('input').keyup(function () {
if (/[ebzl]*/i.test($(this).val())) {
// do something
}
});
Upvotes: 0
Views: 44