Regexp::Wildcards 0.06
Sponsored Links
Regexp::Wildcards 0.06 Ranking & Summary
File size:
0.009 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
852
Date added:
2007-06-29
Publisher:
Vincent Pit
Regexp::Wildcards 0.06 description
Regexp::Wildcards is a Perl module that converts wildcard expressions to Perl regular expressions.
SYNOPSIS
use Regexp::Wildcards qw/wc2re/;
my $re;
$re = wc2re a{b?,c}* => unix; # Do it Unix style.
$re = wc2re a?,b* => win32; # Do it Windows style.
$re = wc2re *{x,y}? => jokers; # Process the jokers & escape the rest.
$re = wc2re %a_c% => sql; # Turn SQL wildcards into regexps.
In many situations, users may want to specify patterns to match but dont need the full power of regexps. Wildcards make one of those sets of simplified rules. This module converts wildcard expressions to Perl regular expressions, so that you can use them for matching. It handles the * and ? shell jokers, as well as Unix bracketed alternatives {,}, but also % and _ SQL wildcards. Backspace () is used as an escape character. Wrappers are provided to mimic the behaviour of Windows and Unix shells.
VARIABLES
These variables control if the wildcards jokers and brackets must capture their match. They can be globally set by writing in your program
$Regexp::Wildcards::CaptureSingle = 1;
# From then, "exactly one" wildcards are capturing
or can be locally specified via local
{
local $Regexp::Wildcards::CaptureSingle = 1;
# In this block, "exactly one" wildcards are capturing.
...
}
# Back to the situation from before the block
This section describes also how those elements are translated by the functions.
$CaptureSingle
When this variable is true, each occurence of unescaped "exactly one" wildcards (i.e. ? jokers or _ for SQL wildcards) are made capturing in the resulting regexp (they are be replaced by (.)). Otherwise, they are just replaced by .. Default is the latter.
For jokers :
a???b?? is translated to a(.)(.)(.)b?(.) if $CaptureSingle is true
a...b?. otherwise (default)
For SQL wildcards :
a___b__ is translated to a(.)(.)(.)b_(.) if $CaptureSingle is true
a...b_. otherwise (default)
$CaptureAny
By default this variable is false, and successions of unescaped "any" wildcards (i.e. * jokers or % for SQL wildcards) are replaced by one single .*. When it evalutes to true, those sequences of "any" wildcards are made into one capture, which is greedy ((.*)) for $CaptureAny > 0 and otherwise non-greedy ((.*?)).
For jokers :
a***b** is translated to a.*b*.* if $CaptureAny is false (default)
a(.*)b*(.*) if $CaptureAny > 0
a(.*?)b*(.*?) otherwise
For SQL wildcards :
a%%%b%% is translated to a.*b%.* if $CaptureAny is false (default)
a(.*)b%(.*) if $CaptureAny > 0
a(.*?)b%(.*?) otherwise
$CaptureBrackets
If this variable is set to true, valid brackets constructs are made into ( | ) captures, and otherwise they are replaced by non-capturing alternations ((?: | )), which is the default.
a{b},{c} is translated to a(b}|{c) if $CaptureBrackets is true
a(?:b}|{c) otherwise (default)
SYNOPSIS
use Regexp::Wildcards qw/wc2re/;
my $re;
$re = wc2re a{b?,c}* => unix; # Do it Unix style.
$re = wc2re a?,b* => win32; # Do it Windows style.
$re = wc2re *{x,y}? => jokers; # Process the jokers & escape the rest.
$re = wc2re %a_c% => sql; # Turn SQL wildcards into regexps.
In many situations, users may want to specify patterns to match but dont need the full power of regexps. Wildcards make one of those sets of simplified rules. This module converts wildcard expressions to Perl regular expressions, so that you can use them for matching. It handles the * and ? shell jokers, as well as Unix bracketed alternatives {,}, but also % and _ SQL wildcards. Backspace () is used as an escape character. Wrappers are provided to mimic the behaviour of Windows and Unix shells.
VARIABLES
These variables control if the wildcards jokers and brackets must capture their match. They can be globally set by writing in your program
$Regexp::Wildcards::CaptureSingle = 1;
# From then, "exactly one" wildcards are capturing
or can be locally specified via local
{
local $Regexp::Wildcards::CaptureSingle = 1;
# In this block, "exactly one" wildcards are capturing.
...
}
# Back to the situation from before the block
This section describes also how those elements are translated by the functions.
$CaptureSingle
When this variable is true, each occurence of unescaped "exactly one" wildcards (i.e. ? jokers or _ for SQL wildcards) are made capturing in the resulting regexp (they are be replaced by (.)). Otherwise, they are just replaced by .. Default is the latter.
For jokers :
a???b?? is translated to a(.)(.)(.)b?(.) if $CaptureSingle is true
a...b?. otherwise (default)
For SQL wildcards :
a___b__ is translated to a(.)(.)(.)b_(.) if $CaptureSingle is true
a...b_. otherwise (default)
$CaptureAny
By default this variable is false, and successions of unescaped "any" wildcards (i.e. * jokers or % for SQL wildcards) are replaced by one single .*. When it evalutes to true, those sequences of "any" wildcards are made into one capture, which is greedy ((.*)) for $CaptureAny > 0 and otherwise non-greedy ((.*?)).
For jokers :
a***b** is translated to a.*b*.* if $CaptureAny is false (default)
a(.*)b*(.*) if $CaptureAny > 0
a(.*?)b*(.*?) otherwise
For SQL wildcards :
a%%%b%% is translated to a.*b%.* if $CaptureAny is false (default)
a(.*)b%(.*) if $CaptureAny > 0
a(.*?)b%(.*?) otherwise
$CaptureBrackets
If this variable is set to true, valid brackets constructs are made into ( | ) captures, and otherwise they are replaced by non-capturing alternations ((?: | )), which is the default.
a{b},{c} is translated to a(b}|{c) if $CaptureBrackets is true
a(?:b}|{c) otherwise (default)
Regexp::Wildcards 0.06 Screenshot
Regexp::Wildcards 0.06 Keywords
CaptureAny
SQL
CaptureSingle
Wildcards 0.06
perl regular expressions
sql wildcards
regular expressions
Perl module
replaced by
b
wildcards
expressions
Perl
jokers
otherwise
Regexp::Wildcards
Bookmark Regexp::Wildcards 0.06
Regexp::Wildcards 0.06 Copyright
WareSeeker periodically updates pricing and software information of Regexp::Wildcards 0.06 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Regexp::Wildcards 0.06 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
perl regular expressions pattern matching
perl regular expressions tutorial
perl regular expressions matches
perl regular expressions examples
perl regular expressions string
oracle sql wildcards
perl regular expressions replace
perl regular expressions whitespace
sql wildcards like
expressions furniture
jokers update
perl regular expressions reference
perl regular expressions special characters
sql wildcards string
perl regular expressions $1
jokers big brother
education otherwise
aim expressions
Related Software
Regexp::Parser is a Perl module for parsing regexes. Free Download
RegExplorer project is a regular Expression Explorer. Free Download
Regexp::Extended is a Perl wrapper that extends the re module with new features. Free Download
Regexp::Log::BlueCoat is a regexp builder to parse BlueCoat log files. Free Download
regexxer project is a nifty search/replace tool featuring Perl-style regular expressions. Free Download
Search::Tools::RegExp::Keywords is a Perl module to access regular expressions for keywords. Free Download
Regexp::Assemble is Perl module to assemble multiple Regular Expressions into a single RE. Free Download
Search::Tools::RegExp::Keyword is a Perl module to access regular expressions for a keyword. Free Download
Latest Software
Popular Software
Favourite Software