Okay, let me get this straight: You're looking to extract a sequence of numbers from a string beginning in a "+" symbol and ending in a "," character?
The way you could do that is looping through the string.
let Raw = "udhaiuedh +34242, +132354"
function ExtractNumbers(ToDecode) {
let StartSet = ["+"]
let EndSet = [","," "]
let Cache = ""
let Finished = []
for (Char of ToDecode) {
if (StartSet.includes(Char)) {
if (Cache.length != 0) {
Finished.push(Cache)
}
Cache = ""
} else if (EndSet.includes(Char)) {
if (Cache.length != 0) {
Finished.push(Cache)
}
Cache = ""
} else {
if (Number(Char)) {
Cache = Cache + String(Char)
}
}
}
if (Cache.length != 0) {
Finished.push(Cache)
}
return Finished
}
console.log(ExtractNumbers(Raw))
It's not perfect, but a nice example to get you started :)