Regular expression - PCRE (PHP) - word boundary (\b) and accent characters

non-ascii-characters, pcre, php, regex, utf-8

Solution

It will work, when you add the `u` modifier to your regex

/\b(cum)\b/iu

Problem

Why does the letter `é` count as a word boundary matching `\b` in the following example? Pattern: `/\b(cum)\b/i` Text: `écumé` Matches 'cum' which is not desired. Is it possible to overcome this?

Original source