Can somene clarify to me why does the following code:


Code:
var str = "Oranges, 12.34$, Apples, 21.15$, Bananas, 512.44$, Plums"
var regExp = /(, \d+.\d+.,)/g;
var myarray = str.split(regExp);
var index;
			
for (index in myarray)
{
	document.write(myarray[index] + "<br />");
}

produces following output:


Oranges
, 12.34$,
Apples
, 21.15$,
Bananas
, 512.44$,
Plums



while:


Code:
var regExp = /(?:, \d+.\d+.,)/g;

or

Code:
var regExp = /, \d+.\d+.,/g;

produces:


Oranges
Apples
Bananas
Plums



I know that () are capturing parentheses and (? are non-capturing one but how does this exactly apply to the code above???