Regexp::Parser 0.20 reviewDownload
Regexp::Parser is a Perl module for parsing regexes. This module parses regular expressions (regexes)
Regexp::Parser is a Perl module for parsing regexes.
This module parses regular expressions (regexes). Its default "grammar" is Perl 5.8.4's regex set. Grammar is quoted because the module does not so much define a grammar as let each matched node state what it expects to match next, but there is not currently a way of extracting a complete grammar. This may change in future versions.
This module is designed as a replacement (though not drop-in) for my old YAPE::Regex modules.
Creating an Instance
To use this module as is, load it, and create an instance:
my $parser = Regexp::Parser->new;
Setting a Regex
To have the parser work on a specific regex, you can do use any of the following methods:
$parser = Regexp::Parser->new($regex)
You can send the regex to be parsed as the argument to the constructor.
Clears the parser's memory and sets $regex as the regex to be parsed.
These two approaches do an initial pass over the regex to make sure it is well-formed -- any warnings or errors will be determined during this initial pass.
Regexp::Parser 0.20 keywords