Regular Expressions 101

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
((http[s]?\:)\/\/)?([^\?\:\/#]+)(\:([0-9]+))?(\/[^\?\#]*)?(\?([^#]*))?(#.*)?
/
i

Description

Parses a URL to the different parts

Submitted by AmitK - 10 years ago