lpeg
« Back to VersTracker
Description:
Parsing Expression Grammars For Lua
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: parsing lua peg grammar text-processing parser-generator
Install: brew install lpeg
About:
Lpeg is a powerful pattern-matching library for Lua that implements Parsing Expression Grammars (PEGs). It allows developers to define complex text parsing rules using a clean, concise syntax that integrates seamlessly with Lua code. Unlike traditional regex, Lpeg provides superior composability and avoids many common pitfalls of regular expressions.
Key Features:
  • Parsing Expression Grammar (PEG) implementation
  • Composable pattern matching primitives
  • Direct integration with Lua tables and functions
  • High performance with memoization support
Use Cases:
  • Building custom parsers and compilers
  • Parsing and processing configuration files
  • Implementing domain-specific languages (DSLs)
  • Text processing and data extraction
Alternatives:
  • re – Lpeg's regex-like wrapper, less powerful than native Lpeg syntax
  • LPegLabel – Lpeg extension with labeled failures for better error reporting
Version History
Detected Version Rev Change Commit