Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([01][0-9][0-9]\.|2[0-4][0-9]\.|[0-9][0-9]\.|25[0-5]\.|[0-9]\.)([01][0-9][0-9]\.|2[0-4][0-9]\.|[0-9][0-9]\.|25[0-5]\.|[0-9]\.)([01][0-9][0-9]\.|2[0-4][0-9]\.|[0-9][0-9]\.|25[0-5]\.|[0-9]\.)([01][0-9][0-9]|2[0-4][0-9]|25[0-5]|[0-9][0-9]|[0-9])$
/
gm

Description

Valid 0.0.0.0 1.1.1.1 101.101.101.101 255.255.255.255 156.0.1.10

Submitted by NexRezzo - 10 years ago