]> git.mxchange.org Git - friendica-addons.git/blobdiff - advancedcontentfilter/doc/advancedcontentfilter.md
updated examples for advanced content filter
[friendica-addons.git] / advancedcontentfilter / doc / advancedcontentfilter.md
index f9947b8f32fb8c692411bbbb513406b522948865..7a7f58a93cb2348566e3c529f70a5045845a67af 100644 (file)
@@ -34,8 +34,19 @@ If the expression using a post variables returns `true`, the post will be collap
 
 A post will be collapsed if at least one rule matches, but all matching rule names will be displayed above the collapsed content.
 
+## Examples
+
+
+
 ## Expression Syntax
 
+1. To block specific domains  `body matches "/\\.spiegel\\.de/"`
+2. To block everything that contains the words `body matches "/Guten Morgen/"
+3. To block every occurence of the word facebook with a space in front and after the word `body matches "//s facebook/s /"`
+4. To colapse every post that contains more than 1 image `body matches "/(?:(?:(?:\\[url(?:=.*)?\\])?\\[img(?:=.*)?\\].*\\[\\/img\\]\\s*(?:\\[\\/url\\])?)\\s*){2}/"`
+
+
+
 ### Supported Literals
 
 - **strings** - single and double quotes (e.g. `'hello'`).
@@ -45,9 +56,9 @@ A post will be collapsed if at least one rule matches, but all matching rule nam
 - **booleans** - `true` and `false`.
 - **null** - `null`.
 
-A backslash (``\``) must be escaped by 4 backslashes (``\\\\``) in a string and 8 backslashes (``\\\\\\\\``) in a regex::
+A backslash (``\``) must be escaped by 2 backslashes (``\\``) in a string and 4 backslashes (``\\\\``) in a regex::
 
-`"a\\\\b" matches "/^a\\\\\\\\b$/"`
+`"a\\b" matches "/^a\\\\b$/"`
 
 Control characters (e.g. ``\n``) in expressions are replaced with whitespace. To avoid this, escape the sequence with a single backslash (e.g.  ``\\n``).
 
@@ -506,4 +517,4 @@ You can also retrieve the variables of a specific post by pasting its URL below
                </td>
        </tr>
 </tbody>
-</table>
\ No newline at end of file
+</table>