J
Jeff Thies
I need to remove non digits from a number.
I thought I could do this:
var phone='22-p67s82';
var re=/\D/g;
phone=phone.replace(re,'');
alert(phone) yields: 22-p67s82
What dumb thing am I missing. That regex removes nothing.
(I'd leave the non digits in but it's not my site)
Cheers,
Jeff
I thought I could do this:
var phone='22-p67s82';
var re=/\D/g;
phone=phone.replace(re,'');
alert(phone) yields: 22-p67s82
What dumb thing am I missing. That regex removes nothing.
(I'd leave the non digits in but it's not my site)
Cheers,
Jeff