0

I have this regex in JavaScript:

new RegExp('^[0-9a-z._-]+@{1}[0-9a-z.-]{2,}[.]{1}[a-z]{2,}$','i');

and I want to modify it.

The last part of the mail must have a minimum value: 2 chars and no maximum length so I can put mails such as .localhost .paris .thisismyexample ...

How may I do that?

Bill the Lizard
  • 386,424
  • 207
  • 554
  • 861

1 Answers1

0
new RegExp('\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,}\b','i');
Pedro Lobito
  • 85,689
  • 29
  • 230
  • 253