Because of the space in your filter, the space-tokenizing of $1- is affected, and I would've expected $8- to also be messed up.

One way to fix is to check for the presence of an expected word at a specific place. For example, if $8 is supposed to be a channel name and it's not, then you could parse the region from $9- forward until you find the 1st word matching #* so you know how many extra words to include as $5-whatever and to replace $8- with $9- $10- etc.

Another way is to ensure your filter never contains a space. If not possible to have the snotice contain $encode(the-filter,m) and then display it as $decode($5,m), you can replace the space in your filter with \s or \x20. Note that \s would also match other characters including the TAB.

edit: helps if you give the *ACTUAL* snotice. There's also a way to make a regex that finds the filter by showing the character following the 1st singlequote until the character preceding the 2nd one. But again, that would also glitch if the filter contains a singlequote. Having the ACTUAL format of the ACTUAL snotice would help greatly.

edit: your message also fails if your pattern contains enough spaces to push a $chr(93) within your filter into the $8-. If your filter can contain any character-pattern and so can the offending message being quoted, there will always be a possibility for a filter message to not be handled correctly.

Last edited by maroon; 31/05/21 11:38 AM.