Regular Expressions 101

Community Patterns

host and port regex

0

Regular Expression
PCRE (PHP <7.3)

/
^(?:http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\/?$
/
gm

Description

no description available

Submitted by anonymous - 5 years ago