I have a string in a loop and for every loop, it is filled with texts the looks like this:
\"123 hello everybody 4\" \"4567 stuff is fun 67\" \"12368 more st
Use Regular Expressions:
var re = new RegExp(/^\d+/); //starts with digit, one or more var m = re.exec("4567 stuff is fun 67"); alert(m[0]); //4567 m = re.exec("stuff is fun 67"); alert(m); // null