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
examples/advanced_features.zigmodified+6-6
Changes to examples/advanced_features.zig
@@ -6,7 +6,7 @@ const Composer = .Composer;
66const Lint = .Lint;
77const ComplexityAnalyzer = .ComplexityAnalyzer;
88
9pub fn main() !void {
9pub fn main(init: std.process.Init) !void {
1010 var gpa = std.heap.GeneralPurposeAllocator(.{}){};
1111 defer _ = gpa.deinit();
1212 const allocator = gpa.allocator();
@@ -39,7 +39,7 @@ pub fn main() !void {
3939
4040 std.debug.print("Built pattern: {s}\n", .{pattern});
4141
42 var regex = try Regex.compile(allocator, pattern);
42 var regex = try Regex.compile(allocator, init.io, pattern);
4343 defer regex.deinit();
4444
4545 const test_emails = [_][]const u8{
@@ -78,7 +78,7 @@ pub fn main() !void {
7878 std.debug.print("Phone pattern: {s}\n\n", .{phone_pattern});
7979
8080 // Test phone number pattern
81 var phone_regex = try Regex.compile(allocator, phone_pattern);
81 var phone_regex = try Regex.compile(allocator, init.io, phone_pattern);
8282 defer phone_regex.deinit();
8383
8484 const test_phones = [_][]const u8{
@@ -116,7 +116,7 @@ pub fn main() !void {
116116
117117 std.debug.print("Composed pattern (OR): {s}\n", .{alternatives});
118118
119 var regex = try Regex.compile(allocator, alternatives);
119 var regex = try Regex.compile(allocator, init.io, alternatives);
120120 defer regex.deinit();
121121
122122 const test_strings = [_][]const u8{
@@ -232,7 +232,7 @@ pub fn main() !void {
232232 std.debug.print("Complexity: {s} (score: {d})\n\n", .{ @tagName(complexity.getLevel()), complexity.complexity_score });
233233
234234 // Test the pattern
235 var regex = try Regex.compile(allocator, url_pattern_built);
235 var regex = try Regex.compile(allocator, init.io, url_pattern_built);
236236 defer regex.deinit();
237237
238238 const test_urls = [_][]const u8{
@@ -305,7 +305,7 @@ pub fn main() !void {
305305
306306 std.debug.print("Built pattern: {s}\n\n", .{ipv4_pattern});
307307
308 var regex = try Regex.compile(allocator, ipv4_pattern);
308 var regex = try Regex.compile(allocator, init.io, ipv4_pattern);
309309 defer regex.deinit();
310310
311311 const test_ips = [_][]const u8{