also looking at this
Port to latest zig-master
#2
53 files
+1149
-1017
| @@ -21,29 +21,29 @@ zig-regex is a regular expression engine for Zig featuring Thompson NFA construc | ||
| 21 | 21 | |
| 22 | 22 | ### Core Regex Features |
| 23 | 23 | |
| 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 | | |
| 43 | 43 | |
| 44 | 44 | ### Advanced Features |
| 45 | 45 | |
| 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 | |
| 47 | 47 | - **AST Optimization**: Constant folding, dead code elimination, quantifier simplification |
| 48 | 48 | - **NFA Optimization**: Epsilon transition removal, state merging, transition optimization |
| 49 | 49 | - **Pattern Macros**: Composable, reusable pattern definitions |
| @@ -55,7 +55,7 @@ zig-regex is a regular expression engine for Zig featuring Thompson NFA construc | ||
| 55 | 55 | ### Quality |
| 56 | 56 | |
| 57 | 57 | - **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 | |
| 59 | 59 | - **Memory Safety**: Full control via Zig allocators, no hidden allocations, zero leaks |
| 60 | 60 | - **500+ Tests**: Comprehensive test suite covering core features, edge cases, regressions, and stress tests |
| 61 | 61 | |
formatting only · 7 hidden lines
| @@ -241,6 +241,7 @@ MIT License - see [LICENSE](LICENSE) file for details. formatting only | ||
| 241 | 241 | ## Acknowledgments |
| 242 | 242 | |
| 243 | 243 | Inspired by: |
| 244 | ||
| 244 | 245 | - Ken Thompson's NFA construction algorithm |
| 245 | 246 | - RE2 (Google's regex engine) |
| 246 | 247 | - Rust's regex crate |