Write a readable Melody pattern that matches version strings like 1.2.3 and compile it to a regex for use in JavaScript code.
Replace a hard-to-read existing regex in a codebase with Melody syntax that teammates can understand without regex expertise.
Use the Melody REPL to iteratively build and test a text-matching pattern without switching between tools.
Generate named capture groups from human-readable syntax to extract structured data like dates or email parts from text.
| yoav-lavi/melody | sayanarijit/xplr | unhappychoice/gitlogue | |
|---|---|---|---|
| Stars | 4,746 | 4,755 | 4,729 |
| Language | Rust | Rust | Rust |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 1/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Melody is a small programming language that compiles into regular expressions. Regular expressions are patterns used to search for or validate text, but their syntax is famously hard to read. A pattern like ^v?(\d+)\.(\d+)\.(\d+)$ is difficult to understand at a glance. Melody lets you write the same pattern in plain words and then outputs the equivalent regular expression automatically. The syntax uses English-style keywords. To match one or more digits you write some of <digit>. To match exactly 16 repetitions of the text "na" you write 16 of "na". Named groups called captures let you label parts of a pattern: capture major { some of <digit>, } becomes a named capturing group in the output. The language supports all the usual regular expression concepts including optional parts, lazy matching, character classes, anchors for start and end of a string, and lookaheads. Each feature maps directly to a well-known regex construct. Melody targets ECMAScript regular expressions, which are the kind used in JavaScript and many other environments. The compiler is written in Rust. You can run it as a command-line tool, use an interactive REPL that compiles each line as you type, or try it in a browser-based playground without installing anything. Installation is available through Cargo (the Rust package manager), Homebrew on macOS and Linux, the Arch User Repository, and NixOS. Pre-built binaries for macOS are on the releases page. The project has a book with full documentation at a separate site. The repository is actively maintained with a public changelog. It was built to make regular expressions more approachable by letting developers write patterns that read almost like a description of what they want to match.
A small language that lets you write text-matching patterns in plain English words and compiles them into regular expressions automatically, so you never have to decode cryptic regex syntax again.
Mainly Rust. The stack also includes Rust, Cargo.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.