0

Getting the exception when validating the email using regular expression

Using the below line of code

.match("^[A-Z0-9._%+-]++@[A-Z0-9.-]++.[A-Z]{2,}+$")

enter image description here

Toto
  • 89,455
  • 62
  • 89
  • 125
  • 1
    It seems you didnt escape some characters like the double + Try using an online editor as most descripe issues in the syntax pretty good (https://regexr.com/) – TSH Feb 11 '20 at 07:30

1 Answers1

0

It's the extra "+"s. Have you tried

.match("^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,}$")

P.S. you are only matching full-capital addresses without "a-z".

X Zhang
  • 1,081
  • 7
  • 17