ReviewOS

also looking at this

zig-utils/zig-regex

Port to latest zig-master

#2
Closed armagidon-exception wants to merge main into main
53 files +1149 -1017
README.mdmodified+22-21
Changes to README.md
@@ -21,29 +21,29 @@ zig-regex is a regular expression engine for Zig featuring Thompson NFA construc
2121
2222### Core Regex Features
2323
24| Feature | Syntax | Status |
25|---------|--------|--------|
26| **Literals** | `abc`, `123` | Stable |
27| **Quantifiers** | `*`, `+`, `?`, `{n}`, `{m,n}` | Stable |
28| **Alternation** | `a\|b\|c` | Stable |
29| **Character Classes** | `\d`, `\w`, `\s`, `\D`, `\W`, `\S` | Stable |
30| **Custom Classes** | `[abc]`, `[a-z]`, `[^0-9]` | Stable |
31| **Anchors** | `^`, `$`, `\b`, `\B` | Stable |
32| **Wildcards** | `.` | Stable |
33| **Capturing Groups** | `(...)` | Stable |
34| **Named Groups** | `(?P<name>...)`, `(?<name>...)` | Stable |
35| **Non-capturing** | `(?:...)` | Stable |
36| **Lookahead** | `(?=...)`, `(?!...)` | Stable |
37| **Lookbehind** | `(?<=...)`, `(?<!...)` | Stable |
38| **Backreferences** | `\1`, `\2` | Stable |
39| **Case-insensitive** | `compileWithFlags(..., .{.case_insensitive = true})` | Stable |
40| **Multiline** | `compileWithFlags(..., .{.multiline = true})` | Stable |
41| **Dot-all** | `compileWithFlags(..., .{.dot_matches_newline = true})` | Stable |
42| **Escaping** | `\\`, `\.`, `\n`, `\t`, `\r` | Stable |
24| Feature | Syntax | Status |
25| --------------------- | ------------------------------------------------------- | ------ |
26| **Literals** | `abc`, `123` | Stable |
27| **Quantifiers** | `*`, `+`, `?`, `{n}`, `{m,n}` | Stable |
28| **Alternation** | `a\|b\|c` | Stable |
29| **Character Classes** | `\d`, `\w`, `\s`, `\D`, `\W`, `\S` | Stable |
30| **Custom Classes** | `[abc]`, `[a-z]`, `[^0-9]` | Stable |
31| **Anchors** | `^`, `$`, `\b`, `\B` | Stable |
32| **Wildcards** | `.` | Stable |
33| **Capturing Groups** | `(...)` | Stable |
34| **Named Groups** | `(?P<name>...)`, `(?<name>...)` | Stable |
35| **Non-capturing** | `(?:...)` | Stable |
36| **Lookahead** | `(?=...)`, `(?!...)` | Stable |
37| **Lookbehind** | `(?<=...)`, `(?<!...)` | Stable |
38| **Backreferences** | `\1`, `\2` | Stable |
39| **Case-insensitive** | `compileWithFlags(..., .{.case_insensitive = true})` | Stable |
40| **Multiline** | `compileWithFlags(..., .{.multiline = true})` | Stable |
41| **Dot-all** | `compileWithFlags(..., .{.dot_matches_newline = true})` | Stable |
42| **Escaping** | `\\`, `\.`, `\n`, `\t`, `\r` | Stable |
4343
4444### Advanced Features
4545
46- **Hybrid Execution Engine**: Automatically selects between Thompson NFA (O(n*m)) and optimized backtracking
46- **Hybrid Execution Engine**: Automatically selects between Thompson NFA (O(n\*m)) and optimized backtracking
4747- **AST Optimization**: Constant folding, dead code elimination, quantifier simplification
4848- **NFA Optimization**: Epsilon transition removal, state merging, transition optimization
4949- **Pattern Macros**: Composable, reusable pattern definitions
@@ -55,7 +55,7 @@ zig-regex is a regular expression engine for Zig featuring Thompson NFA construc
5555### Quality
5656
5757- **Zero Dependencies**: Only Zig standard library
58- **Linear Time Matching**: Thompson NFA guarantees O(n*m) worst-case
58- **Linear Time Matching**: Thompson NFA guarantees O(n\*m) worst-case
5959- **Memory Safety**: Full control via Zig allocators, no hidden allocations, zero leaks
6060- **500+ Tests**: Comprehensive test suite covering core features, edge cases, regressions, and stress tests
6161
formatting only · 7 hidden lines
Changes to README.md
@@ -241,6 +241,7 @@ MIT License - see [LICENSE](LICENSE) file for details. formatting only
241241## Acknowledgments
242242
243243Inspired by:
244
244245- Ken Thompson's NFA construction algorithm
245246- RE2 (Google's regex engine)
246247- Rust's regex crate