Closed akonsu closed 7 years ago
I use this regex in a call to Codemirror's stream.match
API (https://codemirror.net/doc/manual.html#modeapi) It requires that the pattern has starting anchor ^
so that it can match a token at the beginning of the stream.
Sorry about the delay. Alright. Will merge if you add a couple of tests ;)
Ping @akonsu :)
Closing for lack of response.
Another way is to just wrap it:
const regex = new RegExp(`^${emailRegex().source}`);
regex.match('unicorn hello@example.com');
//=> false
regex.match('hello@example.com');
//=> true
Why? What's your use-case?