How to use wildcard on text field for button disable

Hi All, I have an email input text field (emailInput) and a button submit.

I'd like to disable the button if the emailInput field does not contain "@" OR if the last 4 characters are not equal to ".???" (dot then any 3 characters to account for .com .net .gov etc. email addresses).

I have the first part figured out {{emailInput.value.split('@').length-1 !=1}}

The wildcard part I cannot figure out how to write. I currently have {{emailInput.value.slice(-4) != ".???"}} but I don't think I'm writing it correctly.

How do I write "last 4 characters not equal to dot then any 3 characters" in Javascript?

Hi there,

Thanks for reaching out to us! I'm curious if just checking if the length is 4 would work in this instance. As in return email.slice(-4).length === 4 But, this doesn't cover any case if the domain is under two characters, like .io.

If not, then using Regex may be the key here. There's a great thread in StackOverflow about it here!