I almost spluttered my coffee all over the keyboard. rotfl!
Why is this in programming/scripting? Well, now you know what the \w and \W classes in regular expressions in Perl (and similar features in other languages) are for.
Yes, I know such filters are silly, but if you are going to write REs for them at least don’t match substrings within words.