Domain regex pattern

Hi Guys!

I am trying to validate domains using the following pattern. However, the regex below does not support .mobi.na domains. Can anyone show me how I can modify it so that it supports .mobi.na domains?


/^([a-z0-9][a-z0-9-]{1,63}).[a-z.]{4,6}$/i

Thanks in advance.

Thanks

No problem. If you need anything else, don’t hesitate to PM me!

/^([a-z0-9][a-z0-9-]{1,63})\\.[a-z\\.]{2,7}$/

All you need to do is change the length range on the end. I’ve shortened it to 2, to support short domains (ca, hk, …) and expanded it to 7, so your extra long domain is handled (mobi.na)

I hope this helps!

Or, ask in public. :eye: