Irssi: opposite of regular expression for /ignore -regexp

Created on 8 Sep 2016  Â·  10Comments  Â·  Source: irssi/irssi

I was wondering how to ignore all messages that do _not_ contain some text.

For this I wanted to use ?! in my -regexp -pattern but when I add such chars I get [INVALID] from the the ignore interpreter. Is there any way to negate a regexp in irssi ?

waiting for feedback

Most helpful comment

As for /ignore, you can ignore text also
sep 08 20:19:27 /IGNORE zzz NICKS
sep 08 20:19:27 /IGNORE afk NICKS
sep 08 20:19:27 /IGNORE away NICKS
as shown above, you could also do
/ignore #channel ALL
/ignore -except -regexp -pattern sometext #channel PUBLICS

All 10 comments

See man regex to see if it's possible, otherwise
/ignore #channel ALL
/ignore -except -channels #channel sometext PUBLICS
should work, or something similar

@LemonBoy is working on a pcre patch, maybe you can try it and see if it works for you
https://github.com/irssi/irssi/pull/412

@vague666
"or something similar" is the problem here :)
I think, but I might be wrong, that what you typed gives a selection from the user "sometext". To my understanding -except cannot be used to filter based on the message content

Regexp-wise I think it is possible, it should be called negative lookahead based on http://www.regular-expressions.info/lookaround.html.

I have no experience on PCRE, but maybe it does help, thanks!

By the way, suggesting to look at man, are you implying this depends on the implementation of regex in my OS rather than the implementation in irssi?

To my knowledge(I have to hedge my bet here a little since ldd irssi shows libpcre.so.3 which to my knowledge isn't used, maybe @ailin-nemui can tell me/us what's going on :) ), I mean irssi uses posix regex which man regex describes the help for, so if you want to know what irssi's regex' can do, look at the man regex man page

As for /ignore, you can ignore text also
sep 08 20:19:27 /IGNORE zzz NICKS
sep 08 20:19:27 /IGNORE afk NICKS
sep 08 20:19:27 /IGNORE away NICKS
as shown above, you could also do
/ignore #channel ALL
/ignore -except -regexp -pattern sometext #channel PUBLICS

   /ignore #channel ALL
   /ignore -except -regexp -pattern sometext #channel PUBLICS

indeed works! I suppose I have messed up something when I tried, possible that I put -except in the end of the chain.

I wish this could go in https://github.com/irssi/irssi/blob/master/docs/manual.txt

But you should try the pcre PR also, we need people who test the implementation and add your comments to the PR

@vague666 I have answered in that thread to get to try PCRE, thanks again for pointing it out.

is this issue solved?

i think so. thanks for checking.

On 1 November 2016 at 16:55, ailin-nemui [email protected] wrote:

is this issue solved?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/irssi/irssi/issues/537#issuecomment-257605082, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AI8aNW1wrFqgMsLN3dYh8wABn2WLwOJZks5q52DogaJpZM4J4LHA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thiagomacieira picture thiagomacieira  Â·  35Comments

ahihi picture ahihi  Â·  9Comments

ePirat picture ePirat  Â·  7Comments

ido picture ido  Â·  13Comments

valberg picture valberg  Â·  3Comments