Skip to content

Instantly share code, notes, and snippets.

@Klerith
Created October 8, 2021 22:56
Show Gist options
  • Select an option

  • Save Klerith/0a7ea40d502ee15adcaa80c42eeac522 to your computer and use it in GitHub Desktop.

Select an option

Save Klerith/0a7ea40d502ee15adcaa80c42eeac522 to your computer and use it in GitHub Desktop.

Revisions

  1. Klerith created this gist Oct 8, 2021.
    4 changes: 4 additions & 0 deletions is-valid-email.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    const isValidEmail = ( email: string ) => {
    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,}))$/;
    return re.test(email);
    }