]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blob - README
Importing Regexp-Wildcards-0.01.tar.gz
[perl/modules/Regexp-Wildcards.git] / README
1 NAME
2     Regexp::Wildcards - Converts wildcards to regexps.
3
4 VERSION
5     Version 0.01
6
7 SYNOPSIS
8         use Regexp::Wildcards qw/wc2re/;
9
10         my $re;
11         $re = wc2re 'a{b.,c}*' => 'unix';
12         $re = wc2re 'a.,b*'    => 'win32';
13
14 DESCRIPTION
15     This module converts wildcards expressions to Perl regular expressions.
16     It handles the "*" and "?" jokers, as well as Unix bracketed
17     alternatives "{,}", and uses the backspace ("\") as an escape character.
18     Wrappers are provided to mimic the behaviour of Windows and Unix shells.
19
20 EXPORT
21     Four functions are exported only on request : "wc2re", "wc2re_unix",
22     "wc2re_win32" and "wc2re_jokers".
23
24 FUNCTIONS
25   "wc2re_unix"
26     This function takes as its only argument the wildcard string to process,
27     and returns the corresponding regular expression (or "undef" if the
28     source is invalid) according to standard Unix wildcard rules. It
29     successively escapes all regexp special characters that doesn't hold any
30     meaning for wildcards, turns jokers into their regexp equivalents, and
31     changes bracketed blocks into alternations. If brackets are unbalanced,
32     it will try to substitute as many of them as possible, and then escape
33     the remaining "{" and "}".
34
35   "wc2re_win32"
36     Similar to the precedent, but for Windows wildcards. Bracketed blocks
37     are no longer handled (which means that brackets will be escaped), but
38     you can still provide a comma-separated list of items.
39
40   "wc2re_jokers"
41     This one only handles the "?" and "*" jokers.
42
43   "wc2re"
44     A generic function that wraps around all the different rules. The first
45     argument is the wildcard expression, and the second one is the type of
46     rules to apply, currently either "unix", "win32" or "jokers". If the
47     type is undefined, it defaults to "unix".
48
49 SEE ALSO
50     Net::FTPServer has a method for that. Only jokers are translated, and
51     escaping won't preserve them.
52
53     File::Find::Match::Util has a "wildcar" function that compiles a
54     matcher. Only handles "*".
55
56     Text::Buffer has the "convertWildcardToRegex" class method that handles
57     jokers.
58
59 AUTHOR
60     Vincent Pit, "<perl at profvince.com>"
61
62 BUGS
63     Please report any bugs or feature requests to "bug-regexp-wildcards at
64     rt.cpan.org", or through the web interface at
65     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Regexp-Wildcards>. I
66     will be notified, and then you'll automatically be notified of progress
67     on your bug as I make changes.
68
69 SUPPORT
70     You can find documentation for this module with the perldoc command.
71
72         perldoc Regexp::Wildcards
73
74 COPYRIGHT & LICENSE
75     Copyright 2007 Vincent Pit, all rights reserved.
76
77     This program is free software; you can redistribute it and/or modify it
78     under the same terms as Perl itself.
79