I'm trying to extract all e-mails from HTML except for e-mails preceded by a mailto: tag.
It works except when someone has a . in their e-mail address which is fairly common - I've tried look-aheads, different kinds of boundaries and I just can't seem to get regex to exclude the entire e-mail if it has a . in it and is preceded by a mailto: tag
Regex:
(?<!mailto:)(\b[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)
Test string:
Maecenas sed diam eget risus fake.name@domain.net varius blandit sit amet non magna. Sed posuere consectetur est at lobortis. Maecenas faucibus <a href="mailto:fake.name@domain.net">fake.name@domain.net</a> mollis interdum.
The first and last match are fine the 2nd match is .name@domain.net when I don't want it to match at all.