regexp for IPv4 addresses

From: Luc Dore (luc_dore@srtelecom.com)
Date: Tue Jun 14 2005 - 10:36:36 EDT


Good morning fellow admins,

I've been working since yesterday to find a suitable regexp for
filtering IPv4 addresses and the best (pretty good but not perfect) I've
come up with is :

"(^[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]$)"

it filters a lot of the nasties but still allows 10.1.1.299 and 0.0.0.0

Can anybody out there suggest a better one ?

Thanks

-- 
Luc D.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:54 EDT