MCPcopy Create free account
hub / github.com/devs-in-tech/DevsInTech / validEmail

Function validEmail

src/components/Letter.jsx:10–15  ·  view source on GitHub ↗
(email)

Source from the content-addressed store, hash-verified

8 const [error, seterror] = useState("");
9
10 function validEmail(email) {
11 let re =
12 /^(([^<>()\[\]\\.,;:\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,}))$/;
13 if (re.test(email)) return true;
14 else return false;
15 }
16
17 const handleSubmit = (e) => {
18 e.preventDefault();

Callers 1

handleSubmitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected