It seems like you discovered that regex is not the right tool for keyword detection or replacement :)
I like how you explain the role of tries in you eventual solution. I learned from your 'mistake', so thanks for writing.
Thanks :) Completely agree that one size fit all doesn't work. It's just that when we start, we start with a simpler problem and sometimes to scale we need to re-think at an algorithmic level.
PS: Thanks for your feedback :)
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.