So if I had the following string:
\'(01) Kyle Hall - Osc (04) Cygnus - Artereole (07) Forgemasters - Metalic (10) The Todd Terry Project - Back to the Beat (14)
var str = '(01) Kyle Hall - Osc (04) Cygnus - Artereole (07) Forgemasters - Metalic (10) The Todd Terry Project - Back to the Beat (14) Broken Glass - Style of the Street';
var nums = str.match(/\d+/g);
nums.map(function (num) {
return parseInt(num, 10);
});
For browsers that does not support Array.prototype.map
, use this code:
var str = '(01) Kyle Hall - Osc (04) Cygnus - Artereole (07) Forgemasters - Metalic (10) The Todd Terry Project - Back to the Beat (14) Broken Glass - Style of the Street';
var nums = str.match(/\d+/g);
for (var i = 0; i < str.length; i++) {
str[i] = parseInt(str[i], 10);
}