utf-8 word boundary regex in javascript
- by cherouvim
In JavaScript:
"ab abc cab ab ab".replace(/\bab\b/g, "AB");
correctly gives me:
"AB abc cab AB AB"
When I use utf-8 characters though:
"aß aß? ?aß aß aß".replace(/\baß\b/g, "AB");
the word boundary operator doesn't seem to work:
"aß aß? ?aß aß aß"
Is there a solution to this?