Regular Expressions 101

Community Patterns

Detect the Domain Name

0

Regular Expression
PCRE (PHP <7.3)

/
(http|https):\/\/(www\.|ww2\.)*[a-zA-Z0-9-]*[\.][a-zA-Z0-9-]*([\.][a-zA-Z0-9-]*)*
/
g

Description

Detect the Domain Name

Submitted by anonymous - 7 years ago