Tracy R Reed wrote:
> Chris Grau wrote:
>>> I'm a sucker for ugly regular expressions.  Please share.
> 
> Women and children may want to avert their eyes:
> 
> \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
> 
> Or if you want to capture the four numbers of the IP you can use this
> monster:
> 
> (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?

You call that a regex? That ain't so tough.
Go see http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

Regards,
..j


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to