I have never really studied regex so do not really ungerstand it
I have the following regex expression that tests email addresses
^([\\w]+)(\\.[\\w]+)*@([\\w\\-]+\\.){1,5}([A-Za-z]){2,4}$
when i enter example@example.cat it fails but when i enter example@example.com it works… can anyone explain why this is?
EDIT
Have been looking into the code and would this regex fail for the above email addresses?
^\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,6}$
That regexp will not fail for
.catbut match.comyou must have something other issues causing the behavior you are seeing, here is an explanation of theregex:And the second will also accept both given the right escaping (in most languages the double backslashes would cause both not to match):