Pattern matching » History » Version 1
digitalcircuit, 09/13/2018 03:29 AM
Partial version
1 | 1 | digitalcircuit | h1. Pattern matching |
---|---|---|---|
2 | 1 | digitalcircuit | |
3 | 1 | digitalcircuit | *WORK IN PROGRESS* |
4 | 1 | digitalcircuit | |
5 | 1 | digitalcircuit | {{toc}} |
6 | 1 | digitalcircuit | |
7 | 1 | digitalcircuit | h2. Upgrade notice |
8 | 1 | digitalcircuit | |
9 | 1 | digitalcircuit | *This changed in Quassel @0.13@. "Follow the migration guide":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Migrating-from-versions-prior-to-013 if you're upgrading from an earlier version.* |
10 | 1 | digitalcircuit | |
11 | 1 | digitalcircuit | When using the client and core with different versions, some ignore rules will be processed differently. |
12 | 1 | digitalcircuit | |
13 | 1 | digitalcircuit | h2. Breakdown of usage |
14 | 1 | digitalcircuit | |
15 | 1 | digitalcircuit | Quassel supports several types of pattern matching for ignore and highlight rules. |
16 | 1 | digitalcircuit | |
17 | 1 | digitalcircuit | h3. Ignore Rules |
18 | 1 | digitalcircuit | |
19 | 1 | digitalcircuit | |_. @Regular expression@ |_. Item |_. Pattern matching type | |
20 | 1 | digitalcircuit | | Unchecked | @Ignore Rule@ | "Wildcard":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Wildcard | |
21 | 1 | digitalcircuit | | Unchecked | @Scope@ | "Multiple wildcard":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Multiple-wildcard | |
22 | 1 | digitalcircuit | | Checked | @Ignore Rule@ | "Regular expression":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Regular-expression | |
23 | 1 | digitalcircuit | | Checked | @Scope@ | "Multiple wildcard":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Multiple-wildcard | |
24 | 1 | digitalcircuit | |
25 | 1 | digitalcircuit | _For backwards compatibility, the @Regular expression@ checkbox only affects @Ignore Rule@ and not @Scope@._ |
26 | 1 | digitalcircuit | |
27 | 1 | digitalcircuit | h3. Highlight Rules |
28 | 1 | digitalcircuit | |
29 | 1 | digitalcircuit | |_. @RegEx@ |_. Item |_. Pattern matching type | |
30 | 1 | digitalcircuit | | Unchecked | @Rule@ | "Phrase":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Wildcard | |
31 | 1 | digitalcircuit | | Unchecked | @Sender@ | "Multiple wildcard":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Multiple-wildcard | |
32 | 1 | digitalcircuit | | Unchecked | @Channel@ | "Multiple wildcard":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Multiple-wildcard | |
33 | 1 | digitalcircuit | | Checked | @Rule@ | "Regular expression":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Regular-expression | |
34 | 1 | digitalcircuit | | Checked | @Sender@ | "Regular expression":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Regular-expression | |
35 | 1 | digitalcircuit | | Checked | @Channel@ | "Regular expression":https://bugs.quassel-irc.org/projects/quassel-irc/wiki/Pattern_matching#Regular-expression | |
36 | 1 | digitalcircuit | |
37 | 1 | digitalcircuit | _This applies to both @Local Highlights@ and @Remote Highlights@ (or if using Monolithic, @Legacy Highlights@ and @Highlights@)._ |
38 | 1 | digitalcircuit | |
39 | 1 | digitalcircuit | h2. Types |
40 | 1 | digitalcircuit | |
41 | 1 | digitalcircuit | h3. Phrase |
42 | 1 | digitalcircuit | |
43 | 1 | digitalcircuit | This matches exactly what you type. |
44 | 1 | digitalcircuit | |
45 | 1 | digitalcircuit | <pre> |
46 | 1 | digitalcircuit | word |
47 | 1 | digitalcircuit | </pre> |
48 | 1 | digitalcircuit | |
49 | 1 | digitalcircuit | * Matches |
50 | 1 | digitalcircuit | ** @word@ |
51 | 1 | digitalcircuit | ** @A word.@ |
52 | 1 | digitalcircuit | ** @has a word in it@ |
53 | 1 | digitalcircuit | * Does not match |
54 | 1 | digitalcircuit | ** @wording@ |
55 | 1 | digitalcircuit | |
56 | 1 | digitalcircuit | _Changed in Quassel @0.13@:_ |
57 | 1 | digitalcircuit | |
58 | 1 | digitalcircuit | Spaces are matched, too, allowing you to be more specific. |
59 | 1 | digitalcircuit | |
60 | 1 | digitalcircuit | <pre> |
61 | 1 | digitalcircuit | spaced |
62 | 1 | digitalcircuit | </pre> |
63 | 1 | digitalcircuit | |
64 | 1 | digitalcircuit | _There's a leading space in the example above._ |
65 | 1 | digitalcircuit | |
66 | 1 | digitalcircuit | * Matches |
67 | 1 | digitalcircuit | ** @, spaced@ |
68 | 1 | digitalcircuit | ** @is spaced out@ |
69 | 1 | digitalcircuit | * Does not match |
70 | 1 | digitalcircuit | ** @;spaced@ |
71 | 1 | digitalcircuit | |
72 | 1 | digitalcircuit | h3. Wildcard |
73 | 1 | digitalcircuit | |
74 | 1 | digitalcircuit | _Changed in Quassel @0.13@:_ |
75 | 1 | digitalcircuit | |
76 | 1 | digitalcircuit | This uses simple wildcard substitution with @*@ and @?@ to match any characters or a single character, respectively. |
77 | 1 | digitalcircuit | |
78 | 1 | digitalcircuit | <pre> |
79 | 1 | digitalcircuit | *Asking questions\? Nope? |
80 | 1 | digitalcircuit | </pre> |
81 | 1 | digitalcircuit | |
82 | 1 | digitalcircuit | * Matches |
83 | 1 | digitalcircuit | ** @Asking questions? Nopea@ |
84 | 1 | digitalcircuit | ** @Basking questions? Nope.@ |
85 | 1 | digitalcircuit | * Does not match |
86 | 1 | digitalcircuit | ** @Asking questions. Nope.@ |
87 | 1 | digitalcircuit | ** @Asking questions? Nopes.@ |
88 | 1 | digitalcircuit | |
89 | 1 | digitalcircuit | Implicit wildcard is supported, too, allowing you to match everything *except* for what you specify. |
90 | 1 | digitalcircuit | |
91 | 1 | digitalcircuit | <pre> |
92 | 1 | digitalcircuit | !*filter* |
93 | 1 | digitalcircuit | </pre> |
94 | 1 | digitalcircuit | |
95 | 1 | digitalcircuit | * Matches |
96 | 1 | digitalcircuit | ** _Everything, unless it contains something from the below list_ |
97 | 1 | digitalcircuit | * Does not match |
98 | 1 | digitalcircuit | ** @filter@ |
99 | 1 | digitalcircuit | ** @filtering@ |
100 | 1 | digitalcircuit | ** @#nofilter yo@ |
101 | 1 | digitalcircuit | |
102 | 1 | digitalcircuit | Exclamation points can be escaped at the beginning to match something that starts with @!@ (_this is not required elsewhere_). |
103 | 1 | digitalcircuit | |
104 | 1 | digitalcircuit | <pre> |
105 | 1 | digitalcircuit | \!*filter* |
106 | 1 | digitalcircuit | </pre> |
107 | 1 | digitalcircuit | |
108 | 1 | digitalcircuit | * Matches |
109 | 1 | digitalcircuit | ** @!filter@ |
110 | 1 | digitalcircuit | ** @!yes filtering@ |
111 | 1 | digitalcircuit | * Does not match |
112 | 1 | digitalcircuit | ** @filter@ |
113 | 1 | digitalcircuit | |
114 | 1 | digitalcircuit | The @\@ character can be escaped, too, in case you're matching something that starts with @\!@. |
115 | 1 | digitalcircuit | |
116 | 1 | digitalcircuit | <pre> |
117 | 1 | digitalcircuit | \\!*filter* |
118 | 1 | digitalcircuit | </pre> |
119 | 1 | digitalcircuit | |
120 | 1 | digitalcircuit | * Matches |
121 | 1 | digitalcircuit | ** @\!filter@ |
122 | 1 | digitalcircuit | ** @\!yes filtering@ |
123 | 1 | digitalcircuit | * Does not match |
124 | 1 | digitalcircuit | ** @filter@ |
125 | 1 | digitalcircuit | ** @!filter@ |
126 | 1 | digitalcircuit | |
127 | 1 | digitalcircuit | h3. Multiple wildcard |
128 | 1 | digitalcircuit | |
129 | 1 | digitalcircuit | h3. Regular expression |
130 | 1 | digitalcircuit | |
131 | 1 | digitalcircuit | TODO |
132 | 1 | digitalcircuit | |
133 | 1 | digitalcircuit | h2. Migrating from versions prior to @0.13@ |
134 | 1 | digitalcircuit | |
135 | 1 | digitalcircuit | Quassel @0.13@ introduced new behavior for pattern matching to provide more flexibility and to improve performance. |
136 | 1 | digitalcircuit | |
137 | 1 | digitalcircuit | h3. Ignore Rules |
138 | 1 | digitalcircuit | |
139 | 1 | digitalcircuit | |
140 | 1 | digitalcircuit | h3. Highlight Rules |
141 | 1 | digitalcircuit | |
142 | 1 | digitalcircuit | h2. Technical details |
143 | 1 | digitalcircuit | |
144 | 1 | digitalcircuit | For all the technical details and source code changes, take a look at "Quassel pull request #415":https://github.com/quassel/quassel/pull/415 . @MultiPhrase@ is not covered here as Quassel only uses it internally for nickname matching. |