I'm using the following regular expression to validate email addresses:
([_A-Za-z0-9-+]+(.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(.[A-Za-z0-9]+)*(.[A-Za-z]{2,})$)
but I am getting Catastrophic Backtracking in Regular Expression when the string is:
[email protected];[email protected];[email protected];[email protected];
When I remove the last semicolon, the result is true
, but when the semicolon exist in last position in the string then the output is Catastrophic Backtracking, even though I want the result to be false
.