This is my string
var str = "Here is some &text:also , here is &another:one"
var myRegExp = /\b\s(\&){1}(\w)+(\:){1}(\w)+\s?\b/g
str.match(myRegExp)
//[" &text:also", " &another:one"]
Works as expected till now, the problem is with the splitting
str.split(myRegExp)
Expectations: ["Here is some" , ", here is"]
Reality ["Here is some", "&", "t", ":", "o", " , here is", "&", "r", ":", "e", ""]
What could be the reason for this ? I can extract my required array by looping over and splitting at the matches, isnt there any shortcut apart from that ?