javascript - How to return multiple match with regexp? -
this question has answer here:
i tried code:
/\[\[(.*?)\]\]/g
to return multiple matches text this: [[text]] , [[more]] text. instead oftext, more
, returns text
. doing wrong? in advance.
the regex ok:
var test = "[[text]] , [[more]] text.".match(/\[\[(.*?)\]\]/g); console.log(a); > ["[[text]]", "[[more]]"]
Comments
Post a Comment