amyreese / znc-push

Push notification service module for ZNC
http://noswap.com/projects/znc-push
MIT License
556 stars 122 forks source link

Regex highlight (feature request) #38

Open alok0 opened 11 years ago

alok0 commented 11 years ago

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

amyreese commented 11 years ago

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

xbette commented 10 years ago

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

tguild commented 9 years ago

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.

Ennea commented 9 years ago

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

piejanssens commented 9 years ago

+1

piejanssens commented 8 years ago

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.

amyreese commented 8 years ago

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.