I didn’t get a suitable regex that enable to split such string:
72 g tocirah snaeb 101 sgge 108 g darl 111 spuc loi 32 sinihccuz
into strings basing on numbers first occurences like so:
72 g tocirah snaeb, 101 sgge, 108 g darl, 111 spuc loi, 32 sinihccuz
How can i do that:
var str="72 g tocirah snaeb 101 sgge 108 g darl 111 spuc loi 32 sinihccuz";
var regex="/ /";
var result=str.match(regex);
Use:
Search pattern: search an space char followed by one or more numbers and capture the number.
Replace: replace by a , followed by the captured number.
You can test it here: http://jsfiddle.net/2FwKF/3/