[Vuejs]-Issue with match() and email regex expression

0👍

The regex mailto:([^\?]*) matches mailto: and then everything that isn’t ?.

Assuming you’re just trying to capture all mailto URLs (in <a> tags), you could update your regex to capture everything but the closing quote (" or ') of the HTML attribute:

const websiteEmailRegex = 'mailto:([^\"\']+)';

regex demo

Leave a comment