Regular Expressions 101

Community Patterns

subdomain Grabber

0

Regular Expression
PCRE (PHP <7.3)

/
\s(?<subdomain>\S+)(\.\S+){2}\b
/
gm

Description

Gets the subdomain in a url

Submitted by anonymous - 6 years ago