【发布时间】:2016-11-25 04:27:38
【问题描述】:
我有当前的正则表达式:
/(?<=[\s>]|^)#(\w*[A-Za-z_]+\w*)/g
我正在针对字符串进行测试:
Here's a #hashtag and here is #not_a_tag; which should be different. Also testing: Mid#hash. #123 #!@£ and <p>#hash</p>
出于我的目的,在此字符串中应该只检测到两个主题标签。我想知道如何更改表达式,使其不匹配以; 结尾的主题标签,在我的示例中这是#not_a_tag;
干杯。
【问题讨论】: