Regexp:...RI::file(3)
β¨ NAME β¨
okay so bestie, this is Regexp::Common::URI::file β it hands you a pattern for file URIs. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
like, imagine you just wanna know if your input has a file URI in it:
use Regexp::Common qw /URI/;
while (<>) {
/$RE{URI}{file}/ and print "Contains a file URI.\n";
}
slay. it just works π«Ά
π¦ DESCRIPTION π¦
$RE{URI}{file}
so this one returns a pattern that matches file URIs, exactly as defined by RFC 1738 β no cap, that's the spec. file URIs are giving:
"file:" "//" [ host | "localhost" ] "/" fpath
and when you're running it under {-keep}, it hands you back these little babies:
$1β the complete URI. the whole thing. main character energy π$2β the scheme. yep, thefilepart.$3β everything in the URI that comes afterfile://.$4β the hostname.$5β the path name, including the leading slash. slash stays, we stan π$6β the path name, without the leading slash. slash left the chat π
π REFERENCES π
[RFC 1738]β Berners-Lee, Tim, Masinter, L., McCahill, M.: Uniform Resource Locators (URL). December 1994. ancient but iconic, fr fr.
π SEE ALSO π
Regexp::Common::URIβ for all the other URIs it supports. go explore bestie, it's giving collection πΈ
π§ AUTHOR π§
Damian Conway (damian@conway.org) π«Ά
β MAINTENANCE β
This package is maintained by Abigail (regexp-common@abigail.freedom.nl). she's keeping it alive and we're obsessed π
π BUGS AND IRRITATIONS π
Bound to be plenty. honestly? relatable. π
π LICENSE and COPYRIGHT π
This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail.
This module is free software, and maybe used under any of the following licenses β pick your fave, there's a whole menu:
- The Perl Artistic License. See the file
COPYRIGHT.AL. - The Perl Artistic License 2.0. See the file
COPYRIGHT.AL2. - The BSD License. See the file
COPYRIGHT.BSD. - The MIT License. See the file
COPYRIGHT.MIT.
ngl, read the actual license files before you go wild β that's the whole point of listing them π
okay that's the whole page, mwah π β perl v5.42.0, dated 2024-08-09, signing off like the absolute icon it is π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Regexp-Common 2024080801.0.0-160000.2.2 Β· Artistic-1.0 OR Artistic-2.0 OR BSD-3-Clause OR MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms