#2746 [ANN] Pegger v1.0

SlimerDude Wed 12 Jun 2019

Pegger v1.0!

A Parsing Expression Grammar (PEG) for when Regular Expressions just aren't enough!

Pegger is a PEG implementation. It lets you create text parsers by building up a tree of simple matching rules.

Advanced parsing options let you look ahead with predicates and the returned tree of match results gives you plenty of options for transforming it into useful data.

fanr install -r http://eggbox.fantomfactory.org/fanr/ afPegger

Quick start example:

using afPegger::Rule

class Example {
    Void main() {
        rule  := Peg.parseRule("'<'+ name:[a-zA-Z ]+ '>'+")

        rule.match("<<<Hello Mum>>>")["name"]  // --> "Hello Mum"

Pegger Icon

Pegger, as used in Html Parser, Markdown Parser, and more!

Read more on Pegger...

Have fun!

SlimerDude Sun 3 Sep 2023

Hi, I don't usually announce updates to libraries, but I find the extra methods added to the latest Pegger round it out quite nicely, so...

Pegger v1.1.8

Like Regular Expressions, but better!


  • New convenience methods to find(), search(), and replace().
  • More macro rules.
  • More convenience methods in result Matches.
  • Now runs in Javascript!
  • Bug fixes.

Have fun!

Login or Signup to reply.