node.js - 如何使用正则表达式搜索 →
问题描述
我在字符串中有一个 →。(nodejs) \t 不工作。→ 的名称是什么,我该如何对其进行正则表达式?谢谢!
解决方案
它被称为“向右箭头”,U+2192。但由于这是一个普通的 unicode 字符,您可以将其作为文字字符放入模式中,无需特别需要:
const pattern = /→\w+/g;
console.log('→foo→bar'.match(pattern));
推荐阅读
- testing - 共享步骤的 TFS 测试中的不同参数
- kubernetes - GKE:如何挂载持久卷
- javascript - Firefox vs Chrome JavaScript 解释器的异同
- javascript - Javascript:检测浏览器是否为 IE,然后隐藏 HTML
- node.js - Discord 服务器机器人 (js) Heroku 错误
- c# - 尝试查找数组元素时出错
- ios - 如何从侧面菜单视图控制器移回标签栏视图控制器?
- angular - 如何正确处理和控制 Angular 和 Web API 中的错误 - 2
- c - 在链表交换期间未传递指针
- image-processing - libvips 旋转在设备上没有剩余空间