Regular Expressions 101

Community Patterns

IP matching

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(25[0-5]|2[0-4]\d|1?\d\d?)(\.\g<-2>){3}
/
gm

Description

using \g<-n> to match repeated pattern

Submitted by binger - 10 months ago