jqueryregexjquery-inputmask

How to allow more than 3 periods with Jquery-Inputmask email extention alias


I have an issue at work none of us are seeming to find the answer to. We have a jquery input mask being applied with:

$(".email-input").inputmask("email", {showMaskOnHover: false});

It works fine until we had a new user with an email that was johndoe@building.school.district.state.us, it won't allow him to type the last period. The only thing I have tried so far is adding an additional mask with something like this:

$(".email-input").inputmask("email", {showMaskOnHover: false, mask: "[.](1,5)});

but I've tried many different regex inputs here and none of them seem to work or they break the email mask. I've been scouring google for the last week or so and the only thing I can find about it is this and this and help threads that just simply link to those pages. We already have working regex based email validation upon submitting the form, but I can't seem to find a way to do something similar in the jquery mask. This controls it as the user types it and it's a last resort for us to remove this, but we have run out of ideas.

Any help would be greatly appreciated. Obligatory first time posting, this is the first time I've been 100% sure there isn't an answer to my issue on here already. If this info helps at all our back end is c# core, and our front end uses bootstrap.


Solution

  • freedomn-m's comment above is the correct answer. I solved it by using

    $(".email-input").inputmask("email", {showMaskOnHover: false, mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]");\
    

    Just simply add more of these "[.-{1,63}]" to the end.