Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

email validation in typescript

  validateEmail(email) {
    if(email!=''){
      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,}))$/;
      console.log(re.test(String(email).toLowerCase()))
      this.emailTest = re.test(String(email).toLowerCase())
      if (this.emailTest != true) {
        this.toastr.warning("please enter valid email")
        return;
      }

    }
    }
Comment

PREVIOUS NEXT
Code Example
Typescript :: adonisjs decrement 
Typescript :: typescript singleton 
Typescript :: how to find the index of property in array of object in typescript 
Typescript :: serenity grid remove button 
Typescript :: typescript space between capital letters 
Typescript :: Visual Studio Code Typescript region folding 
Typescript :: Define a list of optional keys for Typescript Record 
Typescript :: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds. 
Typescript :: Whats the biggest lesson to know if programming 
Typescript :: ts class without implementation 
Typescript :: check if string include numbers in typescript 
Typescript :: useappselector 
Typescript :: andonis many to many attach 
Typescript :: cannot be used as a jsx component 
Typescript :: mongodb increment array item 
Typescript :: Which command is used to set limits on file size 
Typescript :: ERROR in ngcc is already running at process with id 8108. If you are running multiple builds in parallel then you should pre-process your node_modules via the command line ngcc tool before starting the builds; 
Typescript :: move items from one log to another typescript 
Typescript :: js create batches from array 
Typescript :: nodejs jszip create zip file as buffer 
Typescript :: sum of digits with reduce function 
Typescript :: typescript jest types not found 
Typescript :: colorize brackets vscode 
Typescript :: ts remove first 0 number from string 
Typescript :: how to see what program is using a port 
Typescript :: typescript cannot find name console 
Typescript :: get last item from array ts 
Typescript :: typescript get all enum values 
Typescript :: jasmine test button click 
Typescript :: how to update typescript in global 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =