Community Patterns

Community Library Entry

1

Regular Expression
Created·2025-05-20 09:10
Flavor·PCRE2 (PHP)

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

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