From 7aafdf4566c9c082d45d09dc4f217191c402cfee Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 26 Jan 2015 09:13:22 -0500 Subject: [PATCH] Updated Regular expression based filters (markdown) --- Regular-expression-based-filters.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Regular-expression-based-filters.md b/Regular-expression-based-filters.md index 889a542..785fb96 100644 --- a/Regular-expression-based-filters.md +++ b/Regular-expression-based-filters.md @@ -19,4 +19,10 @@ A most-efficient regex-based filter is one which comes with all the following fi 1. type: a filter which apply only to a specific request type will be executed only for request which matches the type. - Example: `/\.filenuke\.com/.*\/[a-zA-Z0-9]{4}/$script` will be executed only for request of type `script` (this filter is found in _EasyList_) 1. `domain=`: The regular expression won't be executed if the hostname of a request does not match the hostnames declared in the `domain` filter option -1. `third-party`: the regular expression won't be executed if the request does not fulfill the `third-party` option (or it's complement `~third-party`) \ No newline at end of file +1. `third-party`: the regular expression won't be executed if the request does not fulfill the `third-party` option (or it's complement `~third-party`) + +An example of a regex-based filter found in _EasyList_ which is handled very efficiently by µBlock: + + /http:.*(?:\+|\@|\=|\;|\_|\-|\!|\?|\&|\%|\#|\^|\:).*\/\//$script,third-party,domain=allenbwest.com + +This filter contains all the filter options which makes it very unlikely that the regular expression will have to be executed. The regular expression will execute **only** if the request is of type `script`, originates from `allenbwest.com`, and is 3rd-party to `allenbwest.com`. \ No newline at end of file