I want to select all the digits from a given string. I tried with the code below, but it does not return all the numbers in the string:
var match = /\d+/.exec("+12 (345)-678.90[]");
console.log(match.toString());
It only returns 12, while I expect it to return 1234567890.
"+12 (345)-678.90[]".replace(/\D/g, "");should do it/\d+/g.