Comment 2 for bug 1702274

Revision history for this message
Markus Kurtz (mgkurtz) wrote :

This bug seems not to be fixed. The http regex still matches the URLs given in the bug description and the mail regex matches '<<email address hidden>'. Simple regexes that should work in most cases would be

#define HTTP_REGEXP "(ftp|http)s?://[^ \t\n\b]+[^.,!? \t\n\b()<>{}«»„“”‚‘’\\[\\]\'\"]"
#define MAIL_REGEXP "[^ \t\n\b()<>{}«»„“”‚‘’\\[\\]\'\"][^ \t\n\b]*@([^ \t\n\b()<>{}«»„“”‚‘’\\[\\]\'\"]+\\.)+([a-zA-Z]{2,})"

There are more complex regexes around for this job, like the different versions at
https://daringfireball.net/2010/07/improved_regex_for_matching_urls