Answer the question
In order to leave comments, you need to log in
How to get rid of commas in regex output?
How to get rid of commas in regex output?
What would be the numbers without (-) and commas
var str = "My number is: 122-325-557-907";
var reg = /([^-,])+/gi;
console.log(str.match(reg).toString());
Answer the question
In order to leave comments, you need to log in
var str = "My number is: 122-325-557-907";
var reg = /([^-,])+/gi;
console.log(str.match(reg).join(""));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question