YAPE::Regex::Explain - explanation of a regular expression
use YAPE::Regex::Explain; my $exp = YAPE::Regex::Explain->new($REx)->explain;
YAPE
The YAPE hierarchy of modules is an attempt at a unified means of parsing and extracting content. It attempts to maintain a generic interface, to promote simplicity and reusability. The API is powerful, yet simple. The modules do tokenization (which can be intercepted) and build trees, so that extraction of specific nodes is doable.
This module merely sub-classes YAPE::Regex, and produces a rather verbose explanation of a regex, suitable for demonstration and tutorial purposes. Perl 5.6 regex structures like \p{...} and \P{...} and [:...:] are now supported.
YAPE::Regex
\p{...}
\P{...}
[:...:]
YAPE::Regex::Explain
my $p = YAPE::Regex::Explain->new($regex);
Calls YAPE::Regex's new method (see its docs).
new
my $p = YAPE::Regex::Explain->explain($mode);
Returns a string explaining the regex. If $mode is regex, it will output a valid regex (instead of the normal string). If $mode is silent, no comments will be added, but the regex will be expanded into a readable format.
$mode
regex
silent
Visit YAPE's web site at http://www.pobox.com/~japhy/YAPE/.
The YAPE::Regex documentation.
Jeff "japhy" Pinyan CPAN ID: PINYAN japhy@pobox.com http://www.pobox.com/~japhy/
To install YAPE::Regex::Explain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm YAPE::Regex::Explain
CPAN shell
perl -MCPAN -e shell install YAPE::Regex::Explain
For more information on module installation, please visit the detailed CPAN module installation guide.