Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(http[s]?):\/\/([^\/\s:]+)(:(\d+))?(\/[^\s#]*)?(#[^\s]*)?
/
gm

Description

parse http url into scheme, domain, uri, hash, (user port if exist)

Submitted by anonymous - 6 years ago