Skip to content

Add zoptia0regex (Zig regex / RE2 library) to String Processing#236

Merged
jiacai2050 merged 1 commit into
zigcc:mainfrom
zoptia:add-zoptia0regex
Jun 26, 2026
Merged

Add zoptia0regex (Zig regex / RE2 library) to String Processing#236
jiacai2050 merged 1 commit into
zigcc:mainfrom
zoptia:add-zoptia0regex

Conversation

@zoptia

@zoptia zoptia commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Adds zoptia0regex under String Processing.

It's a regular-expression library for Zig: a faithful port of Go's regexp (Russ Cox's RE2 design) — linear-time / ReDoS-proof, with all three of Go's engines (one-pass, bitstate, Pike VM). It's verified by ~30k differential tests against the real Go regexp (byte-for-byte identical, zero leaks, replayed in CI), and benchmarks ~11% faster than Go on average.

  • Apache-2.0, Zig 0.16, build.zig.zon package.
  • Entry follows the existing list format.

@zoptia zoptia requested review from jiacai2050 and xihale as code owners June 26, 2026 00:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the zoptia/zoptia0regex library to the README.md under the string processing section. The reviewer suggests organizing the document by grouping all regular expression libraries under a single section (either "File Format Processing" or "String Processing") to improve consistency and discoverability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread README.md Outdated
- [jecolon/zigstr](https://github.com/jecolon/zigstr) - Zigstr is a UTF-8 string type for Zig programs.
- [ziglibs/string-searching](https://github.com/ziglibs/string-searching) - String(not limited to []const u8)-searching algorithms in Zig.
- [hwu1001/zig-string](https://github.com/hwu1001/zig-string) - A String struct made for Zig.
- [zoptia/zoptia0regex](https://github.com/zoptia/zoptia0regex) - A regular-expression (regex) library — a faithful, linear-time port of Go's regexp (RE2), proven byte-for-byte identical to Go via ~30k differential tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and better discoverability, it would be highly beneficial to group all regular expression (regex) libraries under the same section.

Currently, other regex libraries in this list (such as tiehuis/zig-regex, shaik-abdul-thouhid/ezi-gex, MahBestBro/regex, and kivikakk/libpcre.zig) are located under the File Format Processing section.

Consider either:

  1. Moving this new entry to the File Format Processing section to match the existing libraries.
  2. Moving the existing regex libraries from File Format Processing to the String Processing section (which is arguably a more intuitive home for them) along with this new entry.

@zoptia zoptia force-pushed the add-zoptia0regex branch from 7849c5e to e7dddc7 Compare June 26, 2026 00:35
@zoptia

zoptia commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the catch! I've gone with option 1: moved the entry into File Format Processing, grouped right after the existing regex engines (tiehuis/zig-regex and shaik-abdul-thouhid/ezi-gex), so it's consistent with where the other regex libraries already live.

I kept it to just this entry rather than restructuring others' placements (option 2) to keep the PR minimal — regrouping all the regex libs into a more intuitive home sounds reasonable, but that feels like a maintainer call for a separate change. Happy to follow whatever you prefer.

@jiacai2050 jiacai2050 merged commit bfe57db into zigcc:main Jun 26, 2026
2 checks passed
@jiacai2050

Copy link
Copy Markdown
Member

Agreed, your points are valid and make sense. I will move all those regex libs to string processing later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants