Regular Expressions 101

Community Patterns

IDN domains and subdomains

1

Regular Expression
PCRE (PHP <7.3)

/
^[a-zA-Z0-9\p{L}][a-zA-Z0-9\p{L}-\.]{1,61}[a-zA-Z0-9\p{L}]\.[a-zA-Z\p{L}]{2,}$
/
gmu

Description

Match IDN domains puny code encoded, or in human readable mode.

Submitted by Maslosoft - 8 years ago