Open analog-nico opened 9 months ago
I looked into the generated regex:
(?:[^\W_](?:[a-z\d!#\$%&'\.\*\+\-\/=\?\^_
{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)@...)`
The (?:[^\W_]
part seems to be the culprit. Unfortunately, I don’t understand why it is not an issue if the local part of the email address has more than 1 character.
Describe the bug
I ran it on RunKit and on my local system:
Node.js version: 18.11 and 20.9
OS version: RunKit’s OS and Mac OS X
Description:
emailRegex.test('a@abc.de')
returnsfalse
. Note that the local part has only 1 character. If I add a second character it works fine.Actual behavior
emailRegex.test('a@abc.de')
returnsfalse
Expected behavior
emailRegex.test('a@abc.de')
returnstrue
Code to reproduce
Run this code on RunKit
Checklist