Private IP Address Identifier in Regular Expression

Posted by caseyamcl on Stack Overflow See other posts from Stack Overflow or by caseyamcl
Published on 2010-05-11T19:55:09Z Indexed on 2010/05/11 20:14 UTC
Read the original article Hit count: 296

Hey I'm a total n00b at Regular Expressions. I'm wondering if this is the best way to match a string that starts with a private IP address (Perl-style Regex):

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

Thanks much!

© Stack Overflow or respective owner

Related posts about regex

Related posts about ip-address