Answers for "regular expression to test email address"

7

email validation regex

const emailRegex = RegExp(
    /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/
  );
Posted by: Guest on April-05-2020
1

email validatore regex

//For simple validation including a dot
const emailRegex = RegExp(/^S+@S+.S+$/);
Posted by: Guest on October-07-2021
2

regex pattern to validate email

[a-zA-Z0-9._-]{3,}@[a-zA-Z0-9.-]{3,}.[a-zA-Z]{2,4}
Posted by: Guest on August-08-2020
0

regex validate email

# Language: Perl

sub Validate_Email($)
{
   my $sEmail = $_[0];
   my $sRetMsg = "";

   my $sUserNmRegex = "^[[:alnum:]]+([.!#$%&'*+-/=?^_'{|]?[[:alnum:]]+)*";
   my $sDomainRegex = "@[[:alnum:]]+([.-]{1}[[:alnum:]]+)*";
   my $sEndRegex = "([.]{1}[[:alnum:]]+)+";

   #  Work
   #--------#

   if ($sEmail =~ /$sUserNmRegex$sDomainRegex$sEndRegex$/) {
      $sRetMsg = "Email is valid";
   }
   else {
      $sRetMsg = "Email is not valid";
   }

   return $sRetMsg;
}

my $sEmail = '[email protected]';
print "[Email:$sEmail] : " . Validate_Email($sEmail) . "n";

# OUTPUT -> [Email:[email protected]] : Email is valid
Posted by: Guest on April-17-2020

Code answers related to "regular expression to test email address"

Code answers related to "Javascript"

Browse Popular Code Answers by Language