Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

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

Description

Validates an IPv4 address for use as a URI host as defined in RFC-3986.

Submitted by ezzatron - 11 years ago