Regular Expressions 101

Community Patterns

1...45678...884

strip host port

0

Regular Expression
PCRE (PHP <7.3)

/
^(.*):\/\/(.*)(:\d+)\/(.*)$
/
gm

Description

removes port number from URL

Submitted by pc - a year ago