MCPcopy Create free account
hub / github.com/codecombat/codecombat / validateEmail

Function validateEmail

app/lib/common-utils.js:1–4  ·  view source on GitHub ↗
(email)

Source from the content-addressed store, hash-verified

1function validateEmail(email) {
2 const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
5
6function sleep (ms) {
7 return new Promise(resolve => setTimeout(resolve, ms))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected