mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
replace email validation regex with a simpler alternative
This commit is contained in:
parent
ddbf5f354c
commit
3455223fec
1 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,9 @@ export class UtilityService {
|
|||
// https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
|
||||
@bindThis
|
||||
public validateEmailFormat(email: string): boolean {
|
||||
const regexp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
||||
// Note: replaced MK's complicated regex with a simpler one that is more efficient and reliable.
|
||||
const regexp = /^.+@.+$/;
|
||||
//const regexp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
||||
return regexp.test(email);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue