SyntaxFix
Write A Post
Hire A Developer
Questions
That's because you are forgetting case insensitivity :
Pattern regex = Pattern.compile("\\b[\\w.%-]+@[-.\\w]+\\.[A-Za-z]{2,4}\\b");
This matches your example, although it ignores many valid e-mails.