znc-push
znc-push copied to clipboard
Regex highlight (feature request)
I'd like to see more flexible highlight control using regex
This would be a nice feature for the future, but I don't think I'll be able to implement this anytime soon.
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
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.
And yet another vote. Word boundaries would be extremely valuable for highlights.
+1
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.
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.