Previous: Quoted Constructs, Up: Common Patterns   [Contents][Index]


A.4.4 Addresses

IPv4 Address

(([[:digit:]]{1,3}"."){3}([[:digit:]]{1,3}))

IPv6 Address
hex4         ([[:xdigit:]]{1,4})
hexseq       ({hex4}(:{hex4}*))
hexpart      ({hexseq}|({hexseq}::({hexseq}?))|::{hexseq})
IPv6address  ({hexpart}(":"{IPv4address})?)

See RFC2373 for details.

URI

(([^:/?#]+):)?("//"([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

This pattern is nearly useless, since it allows just about any character to appear in a URI, including spaces and control characters. See RFC2396 for details.