Detects IPv4 and IPv6 addresses
This is loosely based on some other examples, but goes a bit further in terms of what it will and won't match. In particular, it matches IPv6 addresses like ff02::, ff02:1000::, and (the syntactically valid but improbable) ::0001:0002
Submitted by Alan - 8 years ago