No Substring Filter?
See original GitHub issueHopefully I’m missing something or using the package incorrectly but seems like its not finding bad words as substrings…?
import Filter from 'bad-words';
const filter = new Filter();
console.log(filter.clean('xyz ass4ca')); // xyz ass4ca
console.log(filter.clean('xyz 555ass')); // xyz 555ass
console.log(filter.clean('xyz ass')); // xyz ***
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
Filter list of strings, ignoring substrings of other items
A simple quadratic time solution would be this: res = [] n = len(lst) for i in xrange(n): if not any(i != j...
Read more >Python | Filter list of strings based on the substring list
Given two lists of strings string and substr, write a Python program to filter out all the strings in string that contains string...
Read more >Substring filter? - Google Groups
it contains the character at the index given for start and not the character given for end. And uses 0-based indexing. Probably not...
Read more >Filter string not containing substring - Algolia Community
I have a page that loads products and applies a filter. There is a small number of products that I would like not...
Read more >Solved: How to have better substring filter - Alteryx Community
It might be a little overkill, but perhaps a RegEx statement in a Filter Tool checking that there are no letters linking to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It would be nice to at least have the option, as certain racial slurs do not really fit into any other words like Shitake 😃
Fair point but for some use cases it can be desired, for example when we are generating random character serial numbers for item labels, we would like to filter any expletives that can be accidentally generated as as substring