mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-24 14:35:51 +00:00
refactor: update email regex
This commit is contained in:
parent
5afbf72c30
commit
dac26fbd0b
@ -88,7 +88,7 @@ class UserIDPacket {
|
|||||||
* since they interfere with `comment` parsing.
|
* since they interfere with `comment` parsing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const isValidEmail = str => /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(str);
|
const isValidEmail = str => /^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/.test(str);
|
||||||
const firstBracket = userID.indexOf('<');
|
const firstBracket = userID.indexOf('<');
|
||||||
const lastBracket = userID.lastIndexOf('>');
|
const lastBracket = userID.lastIndexOf('>');
|
||||||
if (
|
if (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user