0

Right now I have this regex to validate the domain. It works perfectly fine for all English letter domains but it throws error on characters like ñ. How to make it work for all languages?

Current regex:

/^((https?|ftp|smtp):\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/;
gerkane
  • 3
  • 4
  • 1
    Does this answer your question? [How can I use Unicode-aware regular expressions in JavaScript?](https://stackoverflow.com/questions/280712/how-can-i-use-unicode-aware-regular-expressions-in-javascript) – Poul Bak Sep 20 '22 at 21:34

0 Answers0