想要实现js中的,类似于:
(?<title>.+?)
的效果,即named group,命名的组
就好像没提到有named group
js regexp named group
Named capturing groups in JavaScript regex? – Stack Overflow
js的regexp真垃圾,貌似不支持?
named capture
Trent RichardsonJavascript RegExp Match – Named Captures – Trent Richardson
[总结]
貌似js的RegEx不支持named capture==named group==命名的组
-》虽然有第三方的库,比如:
或者别人实现的类似效果:
Trent RichardsonJavascript RegExp Match – Named Captures – Trent Richardson
Regex named group capturing in JavaScript
http://stackoverflow.com/questions/5367369/named-capturing-groups-in-javascript-regex
-》
就懒得再去折腾了,就用默认的数字的吧。。。
转载请注明:在路上 » [不去解决]js中的正则如何写named group命名的组