To replace words in a line (or remove them, even) requires remembering their colours and retaining that - unless of course the MUD is entirely monochrome.
It won't be easy to get right, people can easily work around profanity filters by using stuff like "f---wit" which gets the meaning across fairly well.
Plus, some words like "cock" and "boob" have multiple meanings, not all of which are profane.
I'd also advise against simply blanking out the word, because you can have a sentence change meaning entirely if you leave words out of it. For example, if someone asks:
Quote:
John asks, has anyone grouped with Peter?
Barbara replies, yes ... fuckwit
Now if you blank out the profanity it changes the meaning somewhat. At least replace the profanity with the usual sort of stuff like $^&%#$!@
What might be easier is to make some sort of "ignore" feature where you simply omit entirely lines from someone who swears a lot, and from whom you don't want to hear from again.