Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(localhost|127.0.0.1|192.168.[0-9]{1,3}\.[0-9]{1,3}):?
/
gmi

Description

Validate localhost:port, 127.0.:port, 192.168.:port

Submitted by anonymous - a year ago