disclaimer: entirely new to regexes
I am trying to write a simple regex to validate email strings like this:
/^\w+@\w+\.\w{1,4}/.test(emailstring);
The above should return false for = a@d.abcde but true for a@d.abcd. I need the extension to be limited to four characters {1,4}. But it always returns true for any length of tld extension. What's wrong in the above expression?