Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

regex for ip validation

Submitted by Amper - 2 years ago