Project

General

Profile

Pattern matching » History » Version 1

Version 1/13 - Next » - Current version
digitalcircuit, 09/13/2018 03:29 AM
Partial version


Pattern matching

WORK IN PROGRESS

Upgrade notice

This changed in Quassel 0.13. Follow the migration guide if you're upgrading from an earlier version.

When using the client and core with different versions, some ignore rules will be processed differently.

Breakdown of usage

Quassel supports several types of pattern matching for ignore and highlight rules.

Ignore Rules

Regular expression Item Pattern matching type
Unchecked Ignore Rule Wildcard
Unchecked Scope Multiple wildcard
Checked Ignore Rule Regular expression
Checked Scope Multiple wildcard

For backwards compatibility, the Regular expression checkbox only affects Ignore Rule and not Scope.

Highlight Rules

RegEx Item Pattern matching type
Unchecked Rule Phrase
Unchecked Sender Multiple wildcard
Unchecked Channel Multiple wildcard
Checked Rule Regular expression
Checked Sender Regular expression
Checked Channel Regular expression

This applies to both Local Highlights and Remote Highlights (or if using Monolithic, Legacy Highlights and Highlights).

Types

Phrase

This matches exactly what you type.

word
  • Matches
    • word
    • A word.
    • has a word in it
  • Does not match
    • wording

Changed in Quassel 0.13:

Spaces are matched, too, allowing you to be more specific.

 spaced

There's a leading space in the example above.

  • Matches
    • , spaced
    • is spaced out
  • Does not match
    • ;spaced

Wildcard

Changed in Quassel 0.13:

This uses simple wildcard substitution with * and ? to match any characters or a single character, respectively.

*Asking questions\?  Nope?
  • Matches
    • Asking questions? Nopea
    • Basking questions? Nope.
  • Does not match
    • Asking questions. Nope.
    • Asking questions? Nopes.

Implicit wildcard is supported, too, allowing you to match everything except for what you specify.

!*filter*
  • Matches
    • Everything, unless it contains something from the below list
  • Does not match
    • filter
    • filtering
    • #nofilter yo

Exclamation points can be escaped at the beginning to match something that starts with ! (this is not required elsewhere).

\!*filter*
  • Matches
    • !filter
    • !yes filtering
  • Does not match
    • filter

The \ character can be escaped, too, in case you're matching something that starts with \!.

\\!*filter*
  • Matches
    • \!filter
    • \!yes filtering
  • Does not match
    • filter
    • !filter

Multiple wildcard

Regular expression

TODO

Migrating from versions prior to 0.13

Quassel 0.13 introduced new behavior for pattern matching to provide more flexibility and to improve performance.

Ignore Rules

Highlight Rules

Technical details

For all the technical details and source code changes, take a look at Quassel pull request #415 . MultiPhrase is not covered here as Quassel only uses it internally for nickname matching.