Text::Glob - Online Linux Manual PageSection : 3
Updated : 2022-01-21
Source : perl v5.34.0
Note : User Contributed Perl Documentation

NAMEText::Glob − match globbing patterns against text

SYNOPSIS​ use Text::Glob qw( match_glob glob_to_regex ); ​ ​ print "matched\n" if match_glob( "foo.*", "foo.bar" ); ​ ​ # prints foo.bar and foo.baz ​ my $regex = glob_to_regex( "foo.*" ); ​ for ( qw( foo.bar foo.baz foo bar ) ) { ​ print "matched: $_\n" if /$regex/; ​ }

DESCRIPTIONText::Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem. If you want to do full file globbing use the File::Glob module instead.

Routinesmatch_glob( $glob, @things_to_test ) Returns the list of things which match the glob from the source list. glob_to_regex( $glob ) Returns a compiled regex which is the equivalent of the globbing pattern. glob_to_regex_string( $glob ) Returns a regex string which is the equivalent of the globbing pattern.

SYNTAXThe following metacharacters and rules are respected. * − match zero or more characters a* matches a, aa, aaaa and many many more. ? − match exactly one character a? matches aa, but not a, or aaa Character sets/ranges example.[ch] matches example.c and example.h demo.[a−c] matches demo.a, demo.b, and demo.c alternation example.{foo,bar,baz} matches example.foo, example.bar, and ​example.baz leading . must be explicitly matched *.foo does not match .bar.foo. For this you must either specify the leading . in the glob pattern (.*.foo), or set ​$Text::Glob::strict_leading_dot to a false value while compiling the regex. * and ? do not match the seperator (i.e. do not match /) *.foo does not match bar/baz.foo. For this you must either explicitly match the / in the glob (*/*.foo), or set ​$Text::Glob::strict_wildcard_slash to a false value while compiling the regex, or change the seperator that Text::Glob uses by setting ​$Text::Glob::seperator to an alternative value while compiling the the regex.

BUGSThe code uses qr// to produce compiled regexes, therefore this module requires perl version 5.005_03 or newer.

AUTHORRichard Clamp <richardc@unixbeard.net>

COPYRIGHTCopyright (C) 2002, 2003, 2006, 2007 Richard Clamp. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSOFile::Glob, glob(3)
0
Johanes Gumabo
Data Size   :   12,232 byte
man-Text::Glob.3pmBuild   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 258,544
Visitor ID   :     :  
Visitor IP   :   3.148.105.127   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|252|Text::Glob.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Text::Glob.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|252|Text::Glob.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Text::Glob.3pm|43|'br══─}─══ |'br══─}─══ )