Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

Matches any IPv4 address.

Submitted by Piwi - 3 years ago (Last modified 3 years ago)