session-pysogs
session-pysogs copied to clipboard
better-profanity doesn't support regular expressions.
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.