Matching word border \b in Unicode

27 views Asked by At

Using XRegExp, this reply in GitHub and this SO post, I am trying to match word border \b in Unicode:

XRegExp = require('xregexp/lib/xregexp')
base = require('xregexp/lib/addons/unicode-base')
base(XRegExp)
XRegExp.addToken(
  /\\b/,
  () => String.raw`(?:(?<=\p{L}\p{M}*)(?!\p{L}\p{M}*)|(?<!\p{L}\p{M}*)(?=\p{L}\p{M}*))`,
  {flag: 'A'}
);
console.log(XRegExp.exec("ааа бб вв", XRegExp(/\bбб\b/), "uA"))

The output is null. What am I missing?

0

There are 0 answers