Updated release tag for trunk changes 4328 to 4330.
[docutils.git] / src / URIre.pm
blob1d674cdbde69750ae19e93ad0f443dd4ed62a8ae
1 # $Id$
2 # Copyright (C) 2002-2005 Freescale Semiconductor, Inc.
3 # Distributed under terms of the GNU General Public License (GPL).
5 package URIre;
7 BEGIN {
8 $digit = "\\d";
9 $alpha = "[a-zA-Z]";
10 $alphanum = "[a-zA-Z0-9]";
11 $hex = "[0-9a-fA-F]";
12 $escaped = "(?:\%${hex}{2}|\\\\.)";
13 $mark = "[-_.!~*\'()]";
14 $unreserved = "(?:$alphanum|$mark)";
15 $reserved = "[;/?:\@&=+\$,]";
16 $uric = "(?:$reserved|$unreserved|$escaped)";
17 $fragment = "(?:$uric)*";
18 $query = "(?:$uric)*";
19 $pchar = "(?:$unreserved|$escaped|[:\@&=+\$,])";
20 $param = "(?:$pchar)*";
21 $segment = "(?:$pchar)*(?:;$param)*";
22 $path_segments = "$segment(?:/$segment)*";
23 $port = "(?:$digit)*";
24 $IPv4address = "$digit\\.$digit\\.$digit\\.$digit";
25 $IPv6address = "\\[(?:$hex*:)+$hex*\\]";
26 $toplabel = "(?:$alpha|$alpha(?:$alphanum|-)*$alphanum)";
27 $domainlabel = "(?:$alphanum|$alphanum(?:$alphanum|-)*$alphanum)";
28 $hostname = "(?:$domainlabel\\.)*$toplabel\\.?";
29 $host = "(?:$hostname|$IPv4address|$IPv6address)";
30 $hostport = "$host(?::$port)?";
31 $userinfo = "(?:$unreserved|$escaped|[;:&=+\$,])*";
32 $server = "(?:(?:$userinfo\@)?$hostport)?";
33 $reg_name = "(?:$unreserved|$escaped|[\$,;:\@&=+])";
34 $authority = "(?:$server|$reg_name)";
35 $scheme = "$alpha(?:$alpha|$digit|[-+.])*";
36 $rel_segment = "(?:$unreserved|$escaped|[;\@&=+\$,])";
37 $abs_path = "/$path_segments";
38 $rel_path = "$rel_segment(?:$abs_path)?";
39 $net_path = "//$authority(?:$abs_path)?";
40 $uric_no_slash = "(?:$unreserved|$escaped|[;?:\@&=+\$,])";
41 $opaque_part = "$uric_no_slash(?:$uric)*";
42 $path = "(?:$abs_path|$opaque_part)?";
43 $hier_part = "(?:$net_path|$abs_path)(?:\\?$query)?";
44 $absoluteURI = "(?:$scheme:(?:$hier_part|$opaque_part))";
45 $relativeURI = "(?:$net_path|$abs_path|$rel_path)(?:\\?$query)?";
46 $URI_reference = "(?:$absoluteURI|$relativeURI)(?:$fragment)?";