Regular Expressions 101

Community Patterns

Your search did not match anything

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^((?:1\d|[1-9])?\d|2(?:[0-4]\d|5[0-5]))(?:\.(?1)){3}$
/
gm

Description

This regular expression strictly matches an IPv4 address. Leading 0 are not matched , take a look at test strings and try your own ones.

Submitted by anonymous - a month ago