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

Releases

mojo-uregex v0.3.3

Choose a tag to compare

@amarbarosys amarbarosys released this 08 Nov 23:04

mojo-uregex-public v0.3.3

Released: 2026-11-08 · Commit: 195d977 · Previous: v0.3.2

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

  • Packaging only: the conda recipe pins mojo-compiler to the minor the package was built with (<1.3.0a0), so it cannot be installed on a Mojo it does not load on.

Changes

Changed

  • recipe.yaml: mojo-compiler run dependency pinned to the build's minor (<1.3.0a0).

Verified

Check Result
pkg-conda dry run on the version commit (H1-H3,H6) PASS: mojo-uregex-0.3.3-hb0f4dca_0.conda

Known limits

  • Packages are built on one Mojo minor only; see the package protocol.

Upgrade / run

None: no API change.

Commits

  • 195d977 build: bump version to 0.3.3
  • 68476a1 build: recipe pins mojo-compiler to the build's minor

mojo-uregex v0.3.2

Choose a tag to compare

@amarbarosys amarbarosys released this 04 Nov 14:36

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

mojo-uregex v0.3.1

Choose a tag to compare

@amarbarosys amarbarosys released this 29 Oct 21:10

mojo-uregex v0.3.1

Released: 2026-10-29 · Commit: 3222bf2 · Previous: v0.3.0

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

  • Builds and runs on the stable Mojo 1.2.0 release.

Changes

Changed

  • The pin moves to Mojo 1.2.0 (pyproject.toml); README says Mojo 1.2.

Fixed

  • The library did not build on Mojo 1.2.0: String(StringSlice(unsafe_from_utf8=...)) sends the compiler into a recursion. It now uses String(unsafe_from_utf8=...), which builds on 1.1 and 1.2.

Verified

Check Result
README setup in an empty directory (mojo==1.2.0), then tools/gate.sh PASS, 14/14 tests, every differential run

Known limits

Upgrade / run

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

Commits

  • 3222bf2 build: Mojo 1.2.0
  • b4f718c fix: String(unsafe_from_utf8=X) instead of wrapping StringSlice
  • fec09c0 docs: NOTICE names the owner and contact

uregex 0.3.0

Choose a tag to compare

@amarbarosys amarbarosys released this 08 Oct 02:01

mojo-uregex v0.3.0

Released: 2026-10-08 · Previous: first release in this repository

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.1.

Highlights

  • 1.9 to 3.1x faster than Python regex on the tokenizer patterns (tools/bench.sh); slowest on plain-ASCII GPT-2 text.
  • Two engines from one source: Pattern for tokenizers, FullPattern for capture groups, named groups, \b \B and fixed-length lookbehind.
  • Byte offsets on UTF-8 input with no copy to codepoints; codepoint offsets on request.
  • Unicode 18.0 general categories and case maps, generated from the Unicode Character Database by tools/gen_unicode.mojo and checked against Python regex.

Changes

First release in this repository. Public API:

  • Pattern(src), FullPattern(src): findall, findall_spans, findall_cps_offsets, search, split_keep; FullPattern adds findall_groups, groups(), group_index(name).
  • One-shot helpers findall, search, split_keep, compile (full syntax).
  • Supported and rejected syntax: README, "Supported syntax".

Verified

Check Result
tools/gate.sh: unit tests, check_unicode.py (every table vs regex 2026.9.29), difftest (every pattern in tools/difftest.py x 5004 random texts, codepoint and byte offsets), negative control PASS: 14/14 tests, 41 tables equal, every pattern equal in both offset modes, negative control caught every pattern
tools/bench.sh: match counts equal Python regex on every tokenizer pattern agree on all 6
Fresh clone: README setup run top to bottom in an empty directory, then tools/gate.sh PASS: mojo==1.1.0 and regex==2026.9.29 from PyPI, full gate green

Known limits

  • Backtracking engine: pathological patterns can be exponential.
  • No backreferences, possessive quantifiers or variable-length lookbehind.
  • FullPattern is slower than Pattern for the same pattern; use Pattern unless you need its syntax.
  • Positions are Int32 internally: inputs over 2 GiB are not supported.

Upgrade / run

python3 -m venv .venv && ./.venv/bin/pip install 'mojo==1.1.0' 'regex==2026.9.29'
./.venv/bin/mojo run -I src tests/test_uregex.mojo
tools/gate.sh

Commits

  • uregex 0.3.0: initial public commit.