iOS exposes an API for this
Here’s a local keyword filtering app that works great: https://github.com/afterxleep/Bouncer
I use Bouncer, but this should be a functionality given by iOS, I don't feel comfortable giving a third party app access to read my messages.
I use Bouncer, but this should be a functionality given by iOS, I don't feel comfortable giving a third party app access to read my messages.