Regexp::Common::URI::ftp(3pm) | User Contributed Perl Documentation | Regexp::Common::URI::ftp(3pm) |
Regexp::Common::URI::ftp -- Returns a pattern for FTP URIs.
use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{FTP}/ and print "Contains an FTP URI.\n"; }
Returns a regex for FTP URIs. Note: FTP URIs are not formally defined. RFC 1738 defines FTP URLs, but parts of that RFC have been obsoleted by RFC 2396. However, the differences between RFC 1738 and RFC 2396 are such that they aren't applicable straightforwardly to FTP URIs.
There are two main problems:
Furthermore, RFC 1738 allows three values for the type specifier, A, I and D (either upper case or lower case). However, the internet draft about FTP URIs [DRAFT-FTP-URL] (which expired in May 1997) notes the lack of consistent implementation of the D parameter and drops D from the set of possible values. We follow this practise; however, RFC 1738 behaviour can be archieved by using the -type = "[ADIadi]"> parameter.
FTP URIs have the following syntax:
"ftp:" "//" [ userinfo "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]]
When using {-password}, we have the syntax:
"ftp:" "//" [ user [ ":" password ] "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]]
Under "{-keep}", the following are returned:
Regexp::Common::URI for other supported URIs.
Damian Conway (damian@conway.org)
This package is maintained by Abigail (regexp-common@abigail.be).
Bound to be plenty.
This software is Copyright (c) 2001 - 2017, Damian Conway and Abigail.
This module is free software, and maybe used under any of the following licenses:
1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT.
2022-10-15 | perl v5.34.0 |