Javascript在两个字符串之间查找字符串,但保持匹配的每个出现

时间:2016-06-02 15:38:09

标签: javascript regex

我希望有人可以提供帮助。我是javascript的新手,整天都在努力完成这项任务。在搜索堆栈溢出和谷歌的其余部分之后 - 我仍然无法解决它。

我有一根绳子:

"This is a sentence with a @@DropIn@@ and the sentence is really @@DropIn2@@. I would like to read more sentances because @@DropIn3@@"

我想要做的是提取@@ @@中的每个字符串。理想情况下,脚本会带回来:

Dropin
Dropin2
DropIn3.

到目前为止,我有这个:

var tmpD = tmp.match(" @@(.*)@@ ")

但这会带来这个:

"DropIn@@ and the sentence is really @@DropIn2@@. I would like to read more sentances because @@DropIn3"

我如何查找每次出现?

0 个答案:

没有答案