Text UtilitiesLesson 106Free preview
Censor Words
This lesson is part of Web Developer Tools · All levels
Summary
Censor words replace certain words with a pseudonym like a star, usually to filter out the rough word. The tool needs to match the variations of the capital letters and the word boundaries so as not to spoil the other words. Text filtering is just a layer of protection, not a substitute for community moderation. For good results, make the list of words and the rules of substitution clear.
Key points
- Determine the list of words and characters that are used
- Matching should be case-insensitive
- Word boundaries prevent words in other words from being censored
- Variations in spelling and leetspeak are important to consider
- Text sensors do not guarantee the user's safety or decency
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.