Make ISEMAIL and ISURL more flexible for longer TLD (#834)

Allow TLD of length up to 24 in ISEMAIL
This commit is contained in:
Vincent Viers
2024-01-31 19:58:50 +01:00
committed by GitHub
parent 36ade2bfd0
commit 6ff4f43b07
3 changed files with 14 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ export const UP_TRIANGLE = '\u25B2';
export const DOWN_TRIANGLE = '\u25BC';
const EMAIL_RE = new RegExp("^\\w[\\w%+/='-]*(\\.[\\w%+/='-]+)*@([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z" +
"0-9])?\\.)+[A-Za-z]{2,6}$", "u");
"0-9])?\\.)+[A-Za-z]{2,24}$", "u");
// Returns whether str starts with prefix. (Note that this implementation avoids creating a new
// string, and only checks a single location.)