Regular Expressions 101

Community Patterns

catch url

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<protocol>[a-z\-]+)?:?(?<slash>\/\/)?(?<host>[a-zA-Z0-9\.]+)?(?P<port>:\d+)?$
/
gm

Description

Matches almost all url

Submitted by anonymous - 3 years ago