带有特殊字符的正则表达式边界词

So

I have an array with some bad words

$badsWords = ['stackoverflow', 'php', 'coding', 'life'];

These can then be used as:

$matchFound = preg_match_all(
                "/\b(" . implode($badWords,"|") . ")(en|ar)?\b/i",
                $string,
                $matches
              );

So if my test input is: stackoverflow it would match.

Is it possible to find a match in a test input like: s.t.a.ckoverflow?

One way is to split the string, word by word and then check against each item in the array if any of the word in the string can be matched. Is there a better way?