[WordFilter] Fix `_isAllFiltered` regex
Injabie3 opened this issue · 0 comments
Injabie3 commented
This helper function is supposed to return True
if everything is filtered (i.e. all asterisks). Its implementation is incorrect as it doesn't take into account word borders:
Current regex is:
[*]+
We expect the following results:
**** *******
=>True
.**** ***cool** **stuff** **man**
=>False
Unfortunately, (2) returns True
instead of False
in the current implementation.
We should change the regex to the following and use the multiline flag:
^\*+$