Filters
Prev
Next

Chapter 5. Filters

Filter Rules and How to Make them

If you just can't figure it out, wait. I want to build a nice “filter builder” where you can just click your way through it. Though, it might be a while.

The filter tries to find the “match” string then use the “From” and “To” as a substitution. The match, from and to are all Perl regex expressions. Rules are evaluated in descending order. The top rule is evaluated first, then the second from the top, etc. All strings are evaluated as:

$name is expanded to the environment variable name. This is done immediately when you insert the rule, and will not change after that time. Therefore it's probably of limited value.

$$name is substituted with the Perl $name variable during the match. This can be substrings such as $1, $2 in the substitution, or normal variables available under sirc (such as $nick, $channel, etc.).

˜name˜ prepended once and only once to the line will send the line of text to the window called name. If the window does not exist it will go to the last window which had focus. There are several special windows, all prefixed by a single !:

!default

The current default window. Guaranteed to exist.

!all

Send to every window. This might not show up on all windows, depending on how the text is parsed. For example, channel windows won't show a /part or /quit unless the nickname is on the channel.

!discard

discards the text.

The rest of the expression is dealt with as normal Perl regex. A good understanding of the perlre man page will definitely help, but a basic understanding of regex is most certainly required.

Prev
Next
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team