Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2026-02-25 11:06
Updated·2026-02-25 11:11
Flavor·PCRE2 (PHP)

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

Description

52 character long regex to validate IP address.

Submitted by Karthik