Javascript REgExp. I want remove all words on the line after :
to ,
Names of the properties must stay.
I tryed this
var sostavRegexp = $(".post .sostav_box").text();
sostavRegexp = sostavRegexp.replace(/:(.*),*/, ' aaaaaaa');
alert(sostavRegexp);
But this changed all words in line from first ":" in line to last "," in line to one word "aaaaaaa".
I have this line
Мука: 200гр, Сахар: 200гр, Маргарин: 100гр,
Need this:
Мука, Сахар, Маргарин
I`m designer, not a programmer. Help me please :)