S. Isaac Dealey wrote:
> If you have the source, change the replace() statement to a
> rereplace() statement and use "(^|[[:space:]])(#word#)([[:space:]]|$)"
> with "\1#repeatstring('*',len(word))#\3" as the replace string. That

This is good, but I can help a bit.

instead of [:space:], I recommend \b, the symbol for a word boundary.
This will match the beginning and end of strings, as well as punctuation
and spaces.

\b(badword1|badword2|badw[aeiou]rd3)\b

> things don't work because anyone can type in any combination of spaces
> and special characters in the middle of the word, i.e. d-a*m#n! ...

On frequently used words, I might do
\b(..etc..,[Ww][\W]*[Oo0][\W]*[Rr][\W]*[Dd],...etc...)\b

where [\W]* matches any non-letter for 0 to infinity. So this will match
"word", "W(#o$$4rD" and the like. Also get creative with repetitive and
missing letters, and many forms of misspellings.

> there are a number of words it's liable to destroy, such as "the
> Chronickles of Rid****" or for that matter, Tim Allen, who's real name
> is Tim Dick... or "**** Cheney". Although to be honest, even if you

Yes, final point, it can't be 100% until you have a human eye behind the
whole application polishing everything off.

-nathan strutz
http://www.dopefly.com/
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to