brave / adblock-rust

Brave's Rust-based adblock engine
Mozilla Public License 2.0
1.46k stars 124 forks source link

"Best-effort" conversion of full-regex rules to content-blocking format #156

Open antonok-edm opened 3 years ago

antonok-edm commented 3 years ago

Currently, full-regex rules are ignored when converting to content-blocking syntax because the content-blocking specification's support for regex features is much worse than what is allowed in ABP-syntax rules.

It should still be possible to convert some rules, by first verifying that the required regex featureset for each is still supported in content-blocking format. However, there will always be rules that cannot be converted.

antonok-edm commented 3 years ago

We'd likely want to use the regex-syntax crate for this purpose - that is what's used internally in the actual regex crate.