i want to split a string in jquery or javascript with multiple separator.
for one string as separator we can have :
var x = "Name: John Doe
Age: 30
Birth Date: 12/12/1981";
var pieces = x.split("
"), part;
for (var i = 0; i < pieces.length; i++) {
bla bla bla
}
But i want to split such that string(x) with : Age:
and Date:
(mean a string array as separator)
and at last i want a sting array with these parts : "Name: John Doe
"," 30
Birth "," 12/12/1981"
that x string is just an example and i dont have any string like that!
how can i rewrite theses codes?