当前位置:
代码迷
>>
JavaScript
>> 怎么用负向预查来匹配非Ing结尾的单词
详细解决方案
怎么用负向预查来匹配非Ing结尾的单词
热度:
160
发布时间:
2013-10-01 12:15:56.0
如何用负向预查来匹配非Ing结尾的单词,
如何用负向预查来匹配
非
ing结尾的单词?
var str = 'going,having,this,it';
var patt = /\b((?!abc)\w)+\b/g;//哎~这个代码写的不对,不知道该怎么写。
alert(str.match(patt));//如何匹配出this和it呢?
如何匹配出this和it呢?
分享到:
------解决方案--------------------
str.match(/\b(?!\b\w+ing)\w+\b/g)
相关解决方案