Regexes can only appear as the last element in a rule:
If regexes were allowed anywhere, things could get very confusing, very quickly.
Regexes are matched against any remaining path elements when they are
first encountered. In the following example:
The match works like this. First, foo (from the include rule) and foo (from the path being evaluated) are compared. Since theres a match, the next element in the path is examined against foos subtree. The only remaining item in the rule tree is a regex, so the regex is compared to the rest of the path being evaluated, joined by the join argument to new (see METHODS/new); namely:
Since the regular expression matches this string, the include rule is matched.
Regex rules are checked before non-regex rules. For example:
If two or more regular expressions at the same level match a path, the
result is undefined:
Create a new instance. Accepts an optional hashref of arguments. The arguments may be:
join String to join remaining path elements with when matching against a regex. Defaults to /, which is good for matching against URLs or filesystem paths.
Add an include path to the rule tree. @path may end with a regex.
Add an exclude path to the rule tree. @path may end with a regex.
Evaluate whether @path should be included (true) or excluded (false). If the include/exclude status cannot be determined (no rules match, more than one regex matches), undef is returned.
Jonathan Rockway, <jrockway at cpan.org>
Please report any bugs or feature requests to bug-algorithm-includeexclude at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-IncludeExclude>. I will be notified, and then youll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
o AnnoCPAN: Annotated CPAN documentation o CPAN Ratings o RT: CPANs request tracker
o Search CPAN
Copyright 2007 Jonathan Rockway, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||ALGORITHM::INCLUDEEXCLUDE (3)||2007-02-08|