Hello Friends,
Welcome To Infinitbility!
Sometimes, we need regex to validate user details like some patterns for example Email validation, phone number validation and many things.
Now, we are going to use regex in react native email validation.
Let’s start today article React Native Regex

What is regex?
A regular expression is a sequence of characters that specifies a search pattern. Usually such patterns are used by string-searching algorithms for “find” or “find and replace” operations on strings, or for input validation.
React Native Regex example
React Native codebase same to javascript then syntax are same for both, we have to write and regex in veriable and use javascript test functionalities to validate.
For now we are going to validate email using regex.
1validateEmail = (email) => {34 if(emailRegex.test(email)){5 return true;6 }else{7 return false;8 }9}
On above code we create validateEmail
function to validate email using regex.
Thanks for reading…
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.