znc-push icon indicating copy to clipboard operation
znc-push copied to clipboard

Regex highlight (feature request)

Open alok0 opened this issue 11 years ago • 7 comments

I'd like to see more flexible highlight control using regex

alok0 avatar Jul 02 '13 21:07 alok0

This would be a nice feature for the future, but I don't think I'll be able to implement this anytime soon.

amyreese avatar Jul 03 '13 17:07 amyreese

This would be awesome.. cause i for examble is getting notification when people write "BetteTina" or something where my nick "Bette" is in.. even if there is something just after Bette.. its annoying :P

xbette avatar Jun 17 '14 18:06 xbette

Another vote for regex

xbette, try living with a name (and nick) like Ted.

I have to comment out values.push_back("%nick%"); in push.cpp because otherwise it matches on words like "started." I set my highlight parameter to _ted which works as long as there are spaces around it and not punctuation or at the start or end of a line. Being able to use \b[Tt]ed\b would handle all scenarios.

tguild avatar Feb 26 '15 14:02 tguild

And yet another vote. Word boundaries would be extremely valuable for highlights.

Ennea avatar Mar 11 '15 11:03 Ennea

+1

piejanssens avatar Sep 24 '15 09:09 piejanssens

How come this isn't in yet? regex is not difficult, especially not in this case where you only need to use a match function.. http://www.boost.org/doc/libs/1_61_0/libs/regex/doc/html/boost_regex/ref/regex_match.html Check out the example.

It's up to the user to register the highlight with a regex query. if match => push message.

piejanssens avatar Oct 12 '16 07:10 piejanssens

ZNC does not provide a regex implementation, and I'm not going to deal with Boost. If someone wants to contribute an implementation using a regex library in a way that falls back to non-regex if the library is not available, then I'd be happy to review a pull request.

Additionally, I would prefer to fix the remaining issues on the Python branch, and get regex handling for free, but that requires dedicating energy that I haven't had lately. Again, pull requests are welcome.

amyreese avatar Oct 12 '16 21:10 amyreese