114
rated 0 times
[
116]
[
2]
/ answers: 1 / hits: 133873
/ 14 Years ago, wed, march 31, 2010, 12:00:00
This works:
var.replace(/[^0-9]+/g, '');
That simple snippet will replace anything that is not a number with nothing.
But decimals are real too. So, I'm trying to figure out how to include a period.
I'm sure it's really simple, but my tests aren't working.
More From » regex