cardoso / Rocket.Chat.ContentFilter

⛔️ Content Filter App for Rocket.Chat - keep scammers and undesirable content out of your server
https://rocket.chat
8 stars 1 forks source link

A couple of questions #6

Open MaestroJAL opened 4 years ago

MaestroJAL commented 4 years ago

First, thanks for this! With a little tweaking I hope to tame Rocket.Chat's aggressive word ban list.

  1. Is this using Javascript Regex rules? I'm struggling to find the right rules that work and I'm a total noob in Regex, but learning as fast as I can.
  2. I'm trying add a global case insensitive to a line. Is this even possible? So far, I totally break everything when I try to add it.

For those looking for a working regex: \b(foo|bar)\b (this bans only the words "foo" and "bar" but no variants)

cardoso commented 4 years ago

Hi!

  1. Yes. It's using JS Regex: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

  2. Can you give an example?

I haven't updated this project in a long time, so I'm surprised anything still works. Which RC version are you using?

MaestroJAL commented 4 years ago

Thanks for the link, I'll read up and learn. I've got RC v2.4.11. So, this is what I've got partially working: \b(foo|bar)\b which matches exactly what I need in the Regex tester I'm using (https://regex101.com/) but I need the global and case insensitive flags added to make it hit Foo, foo, but not football. Does that make sense? In the meantime, I'll head over to the page you linked. Thanks!