Contact: aviboots(AT)netvision.net.il
39,990 questions
51,935 answers
573 users
const s = "javascript7php412hjdsf72q1p0on8mq php 9953"; const arr = s.match(/^\d+|\d+\b|\d+(?=\w)/g) .map(function(n) {return + n;}); console.log(arr); /* run: [7, 412, 72, 1, 0, 8, 9953] */
const s = "javascript7php412hjdsf72q1p0on8mq php 9953"; const arr = s.match(/^\d+|\d+\b|\d+(?=\w)/g); console.log(arr); /* run: ["7", "412", "72", "1", "0", "8", "9953"] */