Files
mtdb_movie/common/resources/client/utils/string/is-email.ts
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

9 lines
311 B
TypeScript
Executable File

const matcher =
/^[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])?)*$/;
export function isEmail(string?: string): boolean {
if (!string) return false;
if (string.length > 320) return false;
return matcher.test(string);
}