This repository was archived by the owner on Nov 22, 2026. It is now read-only.
Repository navigation
mojo-uregex v0.3.2
mojo-uregex-public v0.3.2
Released: 2026-11-04 · Commit: 5428257 · Previous: v0.3.1
What it does
Unicode-aware regular expressions for Mojo, built for the pre-tokenizers of LLM
tokenizers (GPT-2, Llama 3, Qwen, DeepSeek, gpt-oss, Spark-X2.5) and checked
against Python's regex by differential testing. Pure Mojo, CPU. Build with
-I src; requires Mojo 1.2.
Highlights
$matches before a final newline like Python, and\Zand\zare supported.- Patterns Python rejects now raise:
{m,n}withnbelowm,\1..\9and\k<name>backreferences, a trailing\p. - A pattern such as
a{99999999999}raises in milliseconds: the compiled program size is capped.
Changes
Added
$before a final newline,\Zand\z.- The
mojo-uregexskill,docs/api.md,docs/design.mdandscripts/ci.sh. recipe.yaml: a conda package recipe;uv.lockis committed.- CI runs the gate on push and pull request; badges in the README.
Changed
- The compiled program size is capped.
- README: one install block, one example; the gate runs
examples/quickstart.mojo.
Fixed
- A trailing
\praises instead of aborting the process. {m,n}withnbelowmis rejected.\1..\9and\k<name>are rejected, as backreferences are unsupported.- The CI workflow file parsed as invalid YAML; the
uv syncstep is quoted.
Removed
- The unused
to_codepoints.
Verified
| Check | Result |
|---|---|
ci-local at 5428257: the GitHub workflow in a clean Ubuntu 24.04 container, Mojo 1.2.0 |
PASS |
Known limits
- As in v0.3.1.
Upgrade / run
python3 -m venv .venv && ./.venv/bin/pip install 'mojo==1.2.0' 'regex==2026.9.29'
Commits
5428257docs(release): CHANGELOG lists v0.3.2, the release gate reads itde30222fix(ci): quote the uv sync step, the workflow did not parsed85df6ffix(release): pixi.toml, pyproject.toml, recipe.yaml, uv.lock say 0.3.25acd041build: commit uv.lockb1aafcedocs: api.md, design.md, scripts/ci.sh and CI badge19e0fdbdocs(skills): add mojo-uregex skill44a061dbuild: mojo-upgrade config2ce35f9feat(uregex): $ matches before a final newline like Python, add \Z and \zfb2c896build: conda recipe67a0e22fix(uregex): cap the compiled program size, a{99999999999} raises in 40 ms16f1eectest: gate runs examples/quickstart.mojo2202540docs: one example, one install block00fc577ci: run the gate on push and pull request0104174refactor(uregex): delete the unused to_codepoints10bc2e3docs(uregex): Mojo 1.2.0 pins and version 0.3.1 everywhere, README matches the enginef59f89afix(uregex): reject \1..\9 and \k as backreferences938cb27fix(uregex): reject {m,n} with n below m757585dfix(uregex): a trailing \p raises instead of aborting the process8d28cb6docs: latest-release and license badges