Regular Expressions 101

Community Patterns

1...34567...901

Community Library Entry

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