Backed by mandō
Rewrite is the stream transformation engine that rewrites any text, in any pipeline, at any scale. Regex-powered pattern matching meets in-place mutation — the primitive that every CI/CD pipeline, data workflow, and config system secretly depends on.
Shipped by teams at
Features
We took the most powerful text transformation tool ever built and gave it a platform. Eight core features. Zero compromises.
The crown jewel. Match any regular expression against the pattern space and replace it with surgical precision. Supports backreferences (\1–\9), the full match operator (&), and flags that give you total control over every transformation.
Edit files directly on disk. No temp files, no redirects, no copy-and-pray. InPlace™ mutates your files atomically with optional backup suffix — the write-back primitive that every deployment script depends on.
Stack multiple transformation expressions in a single invocation. ChainExec™ composes operations sequentially — each expression receives the output of the previous — enabling arbitrary pipeline depth without subshells.
Store complex transformation logic in dedicated script files. Version them, review them, deploy them. ScriptFile™ turns ad-hoc one-liners into reproducible, auditable transformation artifacts.
Unlock extended regular expressions — grouping, alternation, quantifiers (+, ?, {n,m}) — without the backslash tax. ExtendedRegex™ is the POSIX-compliant power mode that makes complex patterns actually readable.
Apply substitutions to every match on every line — not just the first. GlobalReplace™ is the difference between "fixed one thing" and "fixed everything." The flag that turns spot-fixes into fleet-wide migrations.
A secondary buffer for multi-line transformations, look-aheads, and state accumulation. Copy, append, and exchange between pattern and hold space — the memory model that makes Rewrite Turing-complete.
Target transformations by line number, regex match, or inclusive range. AddressRange™ restricts operations to exactly the lines that matter — surgical precision at stream scale.
How It Works
Pipe any input — files, stdin, command output — into the Rewrite engine. Each line enters the pattern space individually, ready for transformation.
Your expressions execute against each line. Substitute patterns, delete matches, append text, branch conditionally. The full command set processes in sequence.
Use addresses to scope operations. Use hold space for multi-line context. Use branching (b/t) for conditional logic. One pass, infinite possibilities.
Results stream to stdout by default — or write back in-place with -i. Zero intermediate files. Zero temp directories. The transformation is the deployment.
Pricing
From single substitutions to fleet-wide in-place rewrites. Pick the tier that matches your mutation velocity.
For individual developers exploring stream transforms.
s/pattern/replacement/-e expressionp and d commandsFor teams running production pipelines.
g)-i)-e chains-E)For engineering orgs running at scale.
-f)h/H/g/G/x)b/t)a/i/c)y///)For organizations with compliance requirements.
--sandbox)-z)--debug)-n) SLATestimonials
"We replaced a 200-line Python script with a single Rewrite expression. The s/pattern/replacement/g primitive is genuinely all you need for 90% of text processing. This is infra-level engineering."
"InPlace™ changed our deployment workflow. We went from 'copy file, transform, move back' to a single atomic operation. The -i flag with backup suffix is genuinely the best rollback story I've seen."
"The hold space is the most underrated state management primitive in computing. We use HoldSpace™ to do multi-line JSON transforms in CI that would take 10x longer in any other tool. Rewrite is cracked."
"We run Rewrite in every single GitHub Actions workflow. ExtendedRegex™ means our patterns are actually readable in code review. The ChainExec™ pipeline model is just *chef's kiss*."
"I tried to explain to my CTO that we depend on a single stream editor for our entire config management pipeline. He asked what our bus factor was. I said 'zero — it's Rewrite. It doesn't break.'"
Demo
Real commands, real output. Click a transformation to see it execute.
Comparison
| Capability | Rewrite | Manual regex scripts | Find & Replace (IDE) |
|---|---|---|---|
| In-place file editing | ✓ Atomic with backup | Temp files required | Manual save |
| Pipeline composability | ✓ Native stdin/stdout | Partial | ✗ |
| Multi-expression chains | ✓ Unlimited -e | Script-dependent | One at a time |
| Address-scoped transforms | ✓ Line + regex ranges | Custom loops | ✗ |
| Hold space / state | ✓ Built-in | Manual variables | ✗ |
| Single-pass performance | ✓ Always | Implementation varies | File-scan each time |
Case Study
Meridian, a fintech platform serving 2M+ accounts, needed to migrate 4,800 YAML configuration files from legacy key formats to a new schema — across 12 microservices, 3 environments, with zero downtime.
Their DevOps team initially estimated 3 weeks of manual scripting. With Rewrite, they wrote a
single -f script file containing 14 chained substitutions with address ranges and
backreferences, then applied it fleet-wide with -i.bak for atomic rollback.
Changelog
New --sandbox flag disables e, r, and w
commands for secure execution in untrusted pipelines. Enterprise-grade isolation.
--debug annotates program execution with step-by-step trace output. Finally see
exactly what your expressions are doing at each cycle.
-z / --null-data separates lines by NUL characters instead of
newlines. Process binary-safe content and handle filenames with embedded newlines.
FAQ
The g flag applies a single substitution to every match on a line. Multiple
-e expressions apply different transformations sequentially to each line. Use
g when you want to replace all occurrences of one pattern; use -e
chains when you need different transformations in sequence.
Yes. InPlace™ editing with -i.bak creates an automatic backup before any
mutation. Combined with --sandbox mode for untrusted inputs, Rewrite is the
safest stream editor available for production use. Thousands of teams run it in CI/CD with
zero incident rate.
The hold space is a secondary buffer that persists across line cycles. Use it to accumulate
lines (H), swap context (x), or implement multi-line pattern
matching. It's what makes Rewrite capable of transformations that go beyond single-line
substitution — join lines, reorder blocks, implement look-ahead.
Use the N command to append the next line to the pattern space (separated by
\n), then apply multi-line-aware patterns. Combined with P and D
for partial print/delete, you get full multi-line transformation capability in a single
pass.
Yes. The b command branches to a label unconditionally, while t
branches only if the last s/// succeeded. Combined with address ranges and
negation (!), you have a complete control-flow system within the stream editor.
Join 12,000+ engineers who rely on Rewrite for every pipeline, every deploy, every migration.
No credit card. No sales call. Just stream transformations.