如何匹配unicode字符正则表达式

How to match unicode character regex

我有

的输入和正则表达式
  const input = `iPhone Xʀ`;
  
  console.log(input.match(/^([\w\d\-\s]*)/));

我还没弄清楚如何匹配 ʀ unicode 字符。

我尝试了 \p{L},如另一个 SO post 中所述。 还尝试将 u 用于 unicode 作为修饰符。

\p{L}与标志gu结合使用:

const input = `iPhone Xʀ`;
console.log(input.match(/^([\w\d\-\s]*\p{L})/gu));
  
// output:

// [
//  "iPhone Xʀ"
// ]

请获取字符的 Unicode 并使用以下模式。

  const input = `iPhone Xʀ`;
  console.log(input.match(/^([\w\d\-\s]*)\x{0280}/));