Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-10-01 14:25
Flavor·PCRE (Legacy)

/
(?:[^:]+:\/\/)(?:www\.)*([.a-z0-9]+)+
/
Open regex in editor

Description

It will extract the root domain from any URL. This includes removing subdomains, www. and the slug.

Submitted by randywolf244