The module will be available on CPAN shortly. It can also be downloaded from
http://www.pobox.com/~japhy/YAPE/.
Here is a sample use (sorry about the horrible wrapping):
#!/usr/bin/perl
use YAPE::Regex::Explain;
print YAPE::Regex::Explain->new(qr/^\(\d{3}\) \d{3}-\d{4}$/)->explai
+n;
__END__
The regular expression:
(?-imsx:^\(\d{3}\) \d{3}-\d{4}$)
matches as follows:
NODE EXPLANATION
==== ===========
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
^ the beginning of the string
\( '('
\d{3} digits (0-9) (3 times)
\) ')'
' '
\d{3} digits (0-9) (3 times)
- '-'
\d{4} digits (0-9) (4 times)
$ an optional \n followed by the end of the
string
)
japhy --
Perl and Regex Hacker