Regular Expressions 101

Community Patterns

domain name with subdomains

0

Regular Expression
PCRE (PHP <7.3)

~
^[\p{N}\p{L}\-+\.]{1,500}\.[\p{N}\p{L}][\p{L}-]*[\p{N}\p{L}]+$
~
ugm

Description

should match any domain with one or more subdomains

Submitted by Igor Tiulkanov - a year ago