A greedy pattern engine for more than just strings, in Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Scrooge - a greedy pattern engine for more than just strings


This is a greedy pattern matching engine originally conceived as "regexes for PDL". The concept has been broadened to work for any sequential pattern matching on any Perl data structure. Tools for analyzing different data structures are still being developed.


Scrooge is still undergoing sporadic yet active development and may experience non-backwards-compatible changes. Here is a list of things that I intend to implement, in order of importance:

Array test suite

I have a partial implementation of Array data containers. I need to finish a first draft of the test suite so that I can add to it as I create new functionality.

Numeric Array Pattern Generators

Scrooge::Numeric provides a fairly complete suite of tools for parsing numeric intervals and building subroutines to test values against those intervals. I now need to write useful array patterns that make use of these tools.


I have a working implementation for declaring grammars, and which supports action sets and which can be overridden using inheritance. The design needs to be vetted, fleshed-out, tested, and documented.

String Array Pattern Generators

I need to figure out what sorts of patterns could be useful for analyzing string data, and I need to write pattern generators for them for arrays.

Switch to Sub::Exporter for short-form constructors

There are too many pattern generators that might arise, and too many ways for short-named pattern generators to collide in light of useful Huffman encoding. I need to allow the user to choose context-appropriate names for the generators.


Scrooge has been sequence-focused since its inception, but the machinery could be extended to matching against hashes by assuming hashes have zero length and by applying patters that are zero-width assertions. I need to implement pattern generators that work with Hash data containers.


Treating strings as sequences of characters would let me write a parser using Scrooge. Not that it would be a performant one, but it might prove useful in a pinch.


Unless otherwise stated, all contributions in code and documentation are copyright (c) their respective authors, all rights reserved.

Portions of this distribution's code are copyright (c) 2011-2012 Northwestern University.

Portions of this distribution's code are copyright (c) 2013-2015 Dickinson College.

Portions of this distribution's documentation are copyright (c) 2011-2015 David Mertens.

Portions of this distribution's documentation are copyright (c) 2012 Jeff Giegold.

This distribution is free software; you can redistribute it and/or modify it under the same terms as Perl itself.