Forget runtime cost. Maintainability of regex would be tough as people come up with clever new names. And not everyone is a regex wizard, but anyone can add a bad word to a bad word list.
A bayesian filter, like they use in spam, would be more all-encompassing.
19
u/Informal_Swordfish89 Oct 06 '21
Even then still... I'd probably choose to use regex.
It's incredibly flexible and allows easy upscaling.