-1

Right now, I am trying to get international email addresses to validate... right now this regex works like a charm for email addresses:

/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4})$/

However, an international email address like this: amartiñez@yahoo.com will not pass validation. How can I change the above regex to make this pass?

Matthew Green
  • 10,161
  • 4
  • 36
  • 54
Robo Rick
  • 721
  • 6
  • 7

1 Answers1

0

Include Spanish charset to your Regex

^[_a-zA-ZáéíñóúüÁÉÍÑÓÚÜ0-9-]+(\.[_a-zA-ZáéíñóúüÁÉÍÑÓÚÜ0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4})$

DEMO

Source: Interesting Character Classes

emartinelli
  • 1,019
  • 15
  • 28