1Regexp::Common::URI::htUtspe(r3)Contributed Perl DocumenRteagteixopn::Common::URI::http(3)
2
3
4
6 Regexp::Common::URI::http -- Returns a pattern for HTTP URIs.
7
9 use Regexp::Common qw /URI/;
10
11 while (<>) {
12 /$RE{URI}{HTTP}/ and print "Contains an HTTP URI.\n";
13 }
14
16 $RE{URI}{HTTP}{-scheme}
17
18 Provides a regex for an HTTP URI as defined by RFC 2396 (generic syn‐
19 tax) and RFC 2616 (HTTP).
20
21 If "-scheme => P" is specified the pattern P is used as the scheme. By
22 default P is "qr/http/". "https" and "https?" are reasonable alterna‐
23 tives.
24
25 The syntax for an HTTP URI is:
26
27 "http:" "//" host [ ":" port ] [ "/" path [ "?" query ]]
28
29 Under "{-keep}", the following are returned:
30
31 $1 The entire URI.
32
33 $2 The scheme.
34
35 $3 The host (name or address).
36
37 $4 The port (if any).
38
39 $5 The absolute path, including the query and leading slash.
40
41 $6 The absolute path, including the query, without the leading slash.
42
43 $7 The absolute path, without the query or leading slash.
44
45 $8 The query, without the question mark.
46
48 [RFC 2396]
49 Berners-Lee, Tim, Fielding, R., and Masinter, L.: Uniform Resource
50 Identifiers (URI): Generic Syntax. August 1998.
51
52 [RFC 2616]
53 Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L.,
54 Leach, P. and Berners-Lee, Tim: Hypertext Transfer Protocol --
55 HTTP/1.1. June 1999.
56
58 $Log: http.pm,v $
59 Revision 2.101 2004/06/09 21:42:48 abigail
60 POD nits
61
62 Revision 2.100 2003/02/10 21:06:41 abigail
63 http URI
64
66 Regexp::Common::URI for other supported URIs.
67
69 Damian Conway (damian@conway.org)
70
72 This package is maintained by Abigail (regexp-common@abigail.nl).
73
75 Bound to be plenty.
76
78 Copyright (c) 2001 - 2003, Damian Conway. All Rights Reserved.
79 This module is free software. It may be used, redistributed
80 and/or modified under the terms of the Perl Artistic License
81 (see http://www.perl.com/perl/misc/Artistic.html)
82
83
84
85perl v5.8.8 2003-03-23 Regexp::Common::URI::http(3)