Run grex in the browser
Generate a regular expression that matches exactly the example strings you give it.
Try it live
Nothing is downloaded until you press Run.
Build a regex from three examples
Installs grex 1.4.6 from the signed catalog (every chunk is verified before it is written), then runs the commands below in the VM's shell.
grex --version grex foo foobar foobaz
$ grex --version grex 1.4.6 $ grex foo foobar foobaz ^foo(?:ba[rz])?$
What it is
grex takes test cases and produces a single regex that matches all of them and nothing else, optionally generalising digits, whitespace or repetitions (-d, -s, -r). It is a starting point for hand-tuning rather than a finished pattern. In the browser it runs as a regex helper inside docs and editors.
Package facts
- version
1.4.6- runs on
- RISC-V VM (
elf-app,riscv64gc-linux-musl) - download
- 1.1 MB compressed · 1 file
- command
grex- requires
- nothing else — a static binary
- license
Apache-2.0(upstream)- upstream
- github.com/pemistahl/grex
- categories
- Text
- catalog
- generation 12, Ed25519-signed
Install and run it from your page
With the SDK, installApp resolves grex in the signed index, fetches its content-addressed chunks from the CDN, verifies each one and writes the files into the VM. Details in Installing catalog apps.
import { createNano } from "@userland-run/nano-sdk";
const nano = await createNano({ image: { wasm: "/nano/console.wasm" }, ramMB: 512 });
await nano.installApp("grex"); // signature-verified, cached in OPFS
const r = await nano.shExec("grex --version");
console.log(r.stdout);Typical usage of the upstream command-line tool:
grex -r --digits 2024-01-15 2025-12-31
Related apps
- ripgrep14.1.0Search file contents recursively with a regex, fast, respecting .gitignore.RISC-V VM9.2 MB
- sd1.0.0Find and replace text with familiar regex syntax — a simpler sed for substitutions.RISC-V VM956 kB
- numbat1.23.0A statically typed language and calculator for scientific computations with physical units.RISC-V VM2.6 MB