Regex: share the PCRE2 wrapper beyond adblock

Compiled patterns are useful anywhere someone else writes the pattern:
the adblock lists today, agent tool arguments next. The wrapper moves
out of the adblock directory and gains an options struct (case, UTF-8
subjects) and a compile diagnostic the caller can log or show. The App
owns the one context every consumer compiles through, the blocker
included.
This commit is contained in:
Adrià Arrufat committed 2026-09-15 09:33:39 +02:00
1 parent b3c327970f
commit d2f72a9fa9
7 files changed
+141 -67

No files matched your search

+1 -1
View File
@@ -4427,7 +4427,7 @@ test "HttpClient: adblock verdicts apply per request" {
var client: Client = undefined;
initTestClient(&client, &pool);
var blocker: AdBlocker = try .init(testing.allocator);
var blocker: AdBlocker = try .init(testing.allocator, testing.test_app.regex_context);
defer blocker.deinit();
var list: std.Io.Reader = .fixed(
\\||ads.example.com^