下面有regexp,它匹配每个关键字,但在标点符号之前匹配"excel“,在本例中是一个点和一个逗号。
(?<!\S)(excel|technology|technology-based|c#|software & framework|.net)(?!\S)https://regex101.com/r/K1WT05/1
文本: BIexcel通讯excel,nibh优秀的通信quis技术-软件与框架C# Quisque通信技术为基础的沟通技巧。拍卖者优秀的毛竹和c++紫苏.net紫苏。.net微软自我完善.
所以问题是,如何在标点符号之前匹配关键字?
发布于 2019-11-23 16:35:19
转义字符a-z0-9,包括-
let content = `BIexcel communications excel, nibh excellent communications quis technology- software & framework C# Quisque convallis communication technology-based skills vulputate excel.
auctor excellent blandit and c++ catoon .net luctus. .net microsoft self-excel.`
let matches = content.match(/(?<![\w-])(excel|technology|technology-based|c#|software & framework|\.net)(?![\w-])/gi)
console.log(matches)
https://stackoverflow.com/questions/59009610
复制相似问题