Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?:http[s]?:\/\/)?(?:www\.+)?([\-\w]+).*
/
gm

Description

Extracts "example" from URLs like "http://www.example.com"

Submitted by victorocn - 6 years ago