Community Patterns

Community Library Entry

1

Regular Expression
Created·2024-05-03 14:15
Updated·2024-05-03 14:19
Flavor·PCRE2 (PHP)

/
^(?!(10|127|169\.254|192\.168|172\.(2[0-9]|1[6-9]|3[0-1])|(25[6-9]|2[6-9][0-9]|[3-9][0-9][0-9]|99[1-9]))\.)[0-9]{1,3}(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$
/
gm
Open regex in editor

Description

Match only Public IPv4

Does not match Private IPv4

However does match test Nets

Submitted by NozZy