Regular Expressions 101

Community Patterns

Publicly addressable IP addresses, excluding private ranges.

0

Regular Expression
PCRE (PHP <7.3)

/
^(?!(192\.168\.))^(?!(172\.(1[6-9]|2[0-9]|3[0-1])\.))^((([1-9]|1[1-9]|[2-9][0-9]|1[0-9]{2}|2[0-1][0-9]|22[0-3])\.)((0|1[0-9]{0,2}|[2-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}(1[0-9]{0,2}|[2-9][0-9]|2[0-4][0-9]|25[0-4]))$
/
gm

Description

Loading markdown...
Submitted by Schvenn - 8 years ago