Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

mojo-uregex v0.3.2

Choose a tag to compare

@amarbarosys amarbarosys released this 04 Nov 14:36
· 9 commits to main since this release

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 \Z and \z are supported.
  • Patterns Python rejects now raise: {m,n} with n below m, \1..\9 and \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, \Z and \z.
  • The mojo-uregex skill, docs/api.md, docs/design.md and scripts/ci.sh.
  • recipe.yaml: a conda package recipe; uv.lock is 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 \p raises instead of aborting the process.
  • {m,n} with n below m is rejected.
  • \1..\9 and \k<name> are rejected, as backreferences are unsupported.
  • The CI workflow file parsed as invalid YAML; the uv sync step 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

Upgrade / run

python3 -m venv .venv && ./.venv/bin/pip install 'mojo==1.2.0' 'regex==2026.9.29'

Commits

  • 5428257 docs(release): CHANGELOG lists v0.3.2, the release gate reads it
  • de30222 fix(ci): quote the uv sync step, the workflow did not parse
  • d85df6f fix(release): pixi.toml, pyproject.toml, recipe.yaml, uv.lock say 0.3.2
  • 5acd041 build: commit uv.lock
  • b1aafce docs: api.md, design.md, scripts/ci.sh and CI badge
  • 19e0fdb docs(skills): add mojo-uregex skill
  • 44a061d build: mojo-upgrade config
  • 2ce35f9 feat(uregex): $ matches before a final newline like Python, add \Z and \z
  • fb2c896 build: conda recipe
  • 67a0e22 fix(uregex): cap the compiled program size, a{99999999999} raises in 40 ms
  • 16f1eec test: gate runs examples/quickstart.mojo
  • 2202540 docs: one example, one install block
  • 00fc577 ci: run the gate on push and pull request
  • 0104174 refactor(uregex): delete the unused to_codepoints
  • 10bc2e3 docs(uregex): Mojo 1.2.0 pins and version 0.3.1 everywhere, README matches the engine
  • f59f89a fix(uregex): reject \1..\9 and \k as backreferences
  • 938cb27 fix(uregex): reject {m,n} with n below m
  • 757585d fix(uregex): a trailing \p raises instead of aborting the process
  • 8d28cb6 docs: latest-release and license badges