develooper Front page | perl.beginners | Postings from February 2002

YAPE::Regex::Explain pt 2

From:
Tanton Gibbs
Date:
February 22, 2002 02:54
Subject:
YAPE::Regex::Explain pt 2
Message ID:
00ec01c1bb8f$32f7c2a0$45486e0a@brooklyn
Sorry...mail program went bonkers

 prints out

 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
 ----------------------------------------------------------------------
   [A-Za-z_]                any character of: 'A' to 'Z', 'a' to 'z',
                            '_'
 ----------------------------------------------------------------------
   \w*                      word characters (a-z, A-Z, 0-9, _) (0 or
                            more times (matching the most amount
                            possible))
 ----------------------------------------------------------------------
   $                        before an optional \n, and the end of the
                             string
 ----------------------------------------------------------------------
 )                        end of grouping
 ----------------------------------------------------------------------

 This is a great module for people trying to understand other people's
 regexes as well as their own.  The only complaint I have is if you put in
an
 ill formed regex, it will print up to the point where the regex is corrupt,
 but then will just stop and not inform you of a bad regex.  Other than
that,
 it is great!

 Thanks Japhy!

 Tanton

> ----- Original Message -----
> From: "Tanton Gibbs" <thgibbs@deltafarms.com>
> To: <beginners@perl.org>
> Sent: Friday, February 22, 2002 5:50 AM
> Subject: YAPE::Regex::Explain
>
>
> > I just found Jeff Pinyan's YAPE::Regex::Explain module and I must say
that
> > it is a beginners dream.  Now, you can put any cryptic regular expressio
n
> > into his module and it will come out with a dazzling explanation.  For
> > example:
> >
> > print YAPE::Regex::Explain->new( '^[A-Za-z_]\w*$')->explain();
> >
> > prints out:
> >
> >
> >
>




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About