Regex modifier /u in JavaScript?

后端 未结 3 848
说谎
说谎 2020-12-31 03:28

Recently I have created a regex, for my PHP code which allows only the letters (including special characters plus spaces), but now I\'m having a problem with converting it (

3条回答
  •  失恋的感觉
    2020-12-31 04:07

    As of ES2015, /u is supported in JavaScript. See:

    • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode
    • https://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.unicode

提交回复
热议问题