I am currently attempting to make a form of censor which will remove specific words. I am currently dealing with the idea that a user will be able to add spaces in between their letters and bypass the censor.
An example:
Banned word: Apple
Solution: A p p l e
Is there a way to combat this within Regex? My immediate thought is to use something akin to:
(a\s*p\s*p\s*l\s*e\s*)
However I feel like this is not an optimal solution.
If there is a solution to this, please do let me know. Thank you.
Edit:
Apples is not actually a banned word, just a placeholder for more crude words.
The idea of taking away white space and then comparing is not available, as some harmless words can be flagged this way. As an example:
"We need a medic, he's hit --> weneedamediche'[shit]" FLAGGED.