【发布时间】:2011-11-08 23:36:36
【问题描述】:
我有这段文字
txt = "Local residents o1__have called g__in o22__with reports...";
我需要在其中获取每个 o 和 __ 之间的数字列表
如果我这样做
txt.match(/o([0-9]+)__/g);
我会得到
["o1__", "o22__"]
但我想拥有
["1", "22"]
我该怎么做?
【问题讨论】:
-
用于匹配多次重复出现:stackoverflow.com/questions/42328875/…
标签: javascript regex