Why does regex word boundary not match after punctuation characters?