How to Check Email addess is valid or not by using string operations

Maheshr007

New Member
Write a code in RPA tool of your preference to take a string input from the user and check if it's
valid email address or not? A valid e-mail address should meet the below criteria.
a) Only one @ should be present.
b) After @, there should be at least one dot(.)present.
c) After the last dot, there should be at least three characters.
d) Should not contain blank spaces.
Ex: For abc@gmail.com, the result should be true. For abc@gmail, the result should be false.
 

duynd9

New Member
hi Mah

u can use "Find" function in String Operation.
then use "Find String" text box input to Regular expression check email and check to Regular expression check box.
if result back to 1 it true else it false. may be can help u
good luck
 

Ravikiran

New Member
Write a code in RPA tool of your preference to take a string input from the user and check if it's
valid email address or not? A valid e-mail address should meet the below criteria.
a) Only one @ should be present.
b) After @, there should be at least one dot(.)present.
c) After the last dot, there should be at least three characters.
d) Should not contain blank spaces.
Ex: For abc@gmail.com, the result should be true. For abc@gmail, the result should be false.
Please help me with a complete code...
 

itishree

New Member
hi Mah

u can use "Find" function in String Operation.
then use "Find String" text box input to Regular expression check email and check to Regular expression check box.
if result back to 1 it true else it false. may be can help u
good luck
Hi ,
Do you know without using regular expression how to validate?
 

Sachin_Kharmale

Active Member
Hi @Maheshr007 ,

Use bellow regular expression to validate the email id if email id in proper format then it will return true otherwise return false.

^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$


I hope it will help you..!
 

Sachin_Kharmale

Active Member
How to run this code, please give me the code
Hi @Narahari Nusum ,

To validate the email in Blue prism. Use Test Regex Match action which is present in Blue Prism Utility-String VBO.
Just type above expression in Regex Pattern and give your input text in Target string and then run if we provide valid email address in Target string then it will return true otherwise return false. refer bellow screen shot.

View attachment 1579066654431.png
I hope it will help you..!
 

imanpost

New Member
Hi @Narahari Nusum ,

To validate the email in Blue prism. Use Test Regex Match action which is present in Blue Prism Utility-String VBO.
Just type above expression in Regex Pattern and give your input text in Target string and then run if we provide valid email address in Target string then it will return true otherwise return false. refer bellow screen shot.

View attachment 5074
I hope it will help you..!

Thanks. This is useful :)
 

numanjohn

New Member
The following JavaScript shows how to validate email address using Regular Expression .

Code:
function validateEmail(inText){
  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,}))$/;
  var email=document.getElementById(inText).value;
  if(re.test(String(email).toLowerCase()))
  {
    alert("Email is valid  : " + email);
  }
  else
  {
    alert("Email is not valid  :  " + email);
  }
}
 
Top