Posted By

fugue on 04/07/10


Tagged

regex ip routable non-routable


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

dkynyc
Tyster


RegEx to match non-routable IP addresses


 / Published in: Regular Expression
 

Matches 192.168.0.1 or 127.0.0.1, but not 72.125.77.99.

  1. (^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^127\.0\.0\.1)

Report this snippet  

You need to login to post a comment.