5 Scans the message content for the string 'nsfw'
6 (case insensitive) and if found replaces the content
7 with a "click to open/close" link, default is closed.
9 If you click on the 'Not safe for work' plugin under
10 /settings/addon a text field appears, where you can
11 extend the list of search terms. The terms must be
14 It is also possible to enter profile URLs as values.
15 This is quite useful for the case, that you perhaps
16 don't want to see postings by person_A, but person_B
17 is one of your contacts and person_B used to reshare
20 You can also make use of regular expressions.
21 They also have to be seperated by commas and the
22 regex itself has to be enclosed with slashes:
24 ... nsfw, /<REGEX>/, politics,...
31 Let's say you don't want to see postings which contain
34 The term could appear in several ways:
36 fakenews, fake news, fake_news, fake-news, f@ke news,
37 f4ke news, f4k3 n3ws, and so on and so on and so on.
39 You could write every possible version of it as single
40 item into your NSFW-filter list, but this can also be
41 done with a single regex, which matches all of them:
43 /f[@4a]k[3e][-_ ]n[3e]w[sz]/
47 Another use case could be, that you are simply not
48 interested in postings about christmas.
50 /christmas(?:[-_ ]?(?:tree|time|eve|pudding))?/
55 It is absolutely important, that you use grouping
56 parentheses instead of capturing parentheses!!
58 Grouping parentheses are:
62 If you use capturing parentheses, which are
66 it will produce errors and the regex won't work and
67 at least your targets will not get collapsed.
72 Another possibility is the usage of a so called
73 'lookbehind' construct. I'll give an example followed
78 The \b is a word boundary, what matches the beginning
79 and the end of a word. The simple pattern of 'advent'
80 would match advent iteself, but also adventure.
81 This can be prevented by
85 The first part of the regex above
89 is a negative lookbehind. It makes \badvent\b only
90 match, if there is no 'the ' before \badvent\b or in
93 It looks for 'advent', but doesn't match 'the advent'.
96 For more informations take a look at the PCRE regex