session-pysogs icon indicating copy to clipboard operation
session-pysogs copied to clipboard

better-profanity doesn't support regular expressions.

Open ianmacd opened this issue 2 years ago • 0 comments

The great thing about better-profanity is that it is much faster than its long-abandoned predecessor, profanity. It achieves this by matching fixed strings rather than regular expressions, and therein lies a painful trade-off for SOGS operators.

For example, I would like to filter one-word greetings from my groups, and whilst I can list the words themselves, I cannot specify that they match only when they are the only text present.

The lack of support for regex in better-profanity is a clear design decision, so the answer is not to patch that, but to develop a second filter that handles any regex filtering desired by the user.

Ideally, PySOGS would monitor the custom lists of both filters and reload them whenever the mtime changes.

ianmacd avatar Oct 06 '22 07:10 ianmacd