Regular Expressions 101

Community Library

Community Library Entry

2

Regular ExpressionOpen Workspace

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

Description
Created·2024-10-08 14:03
Type·Match
Flavor·PCRE2 (PHP)

Validate an IPv4 address. The addresses are four numbered separated by three dots, and can only have a maximum value of 255 in either octet. Start by trying to validate 172.16.254.1.

Submitted by Anonymous
Open Workspace