Filewatcher File Search File Search
Content Search
» » » » »


Perl module to add grammatical parsing features to Perl 5.10 regexes

Regexp::Grammars adds a small number of new regex constructs that can be used within Perl 5.10 patterns to implement complete recursive-descent parsing.

Perl 5.10 already supports recursive=descent matching, via the new (?<name>...) and (?&name) constructs. This technique makes it possible to use regexes to recognize complex, hierarchical--and even recursive-- textual structures. The problem is that Perl 5.10 doesn't provide any support for extracting that hierarchical data into nested data structures. In other words, using Perl 5.10 you can match complex data, but not parse it into an internally useful form.

An additional problem when using Perl 5.10 regexes to match complex data formats is that you have to make sure you remember to insert whitespace- matching constructs (such as \s*) at every possible position where the data might contain ignorable whitespace. This reduces the readability of such patterns, and increases the chance of errors (typically caused by overlooking a location where whitespace might appear).

The Regexp::Grammars module solves both those problems.

Package version:1.005-1


Regexp::Grammars(User Contributed Perl DocumentRegexp::Grammars(3pm)

       Regexp::Grammars - Add grammatical parsing features to Perl
       5.10 regexes

       This document describes Regexp::Grammars version 1.005

           use Regexp::Grammars;

           my $parser = qr{
                   <Verb>               # Parse and save a Verb in a scala


libregexp-grammars-perl (1.005-1) unstable; urgency=low

  * Initial Release. (Closes: #586750)

 -- Salvatore Bonaccorso <>  Mon, 05 Jul 2010 09:41:33 +0200


Revision history for Regexp-Grammars

1.001_003 Tue Apr  7 08:42:33 2009
       Initial public release.

1.001_004  Sun Aug  2 23:08:52 2009

    * Fixed mishandling of (??{....}) blocks

    * Attempted to patch around three-way bug with lexicals in regexes
      (further testing may be required to ensure patch is effective
       across various perl configs)

1.001_005  Sun Aug  2 23:08:52 200



Browse inside libregexp-grammars-perl_1.005-1_all.deb

         [DIR]DEBIAN/ (2)  65535+ mirrors
         [DIR]usr/ (1)  65535+ mirrors

Download libregexp-grammars-perl_1.005-1_all.deb

Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2016