hwg-techniques archives | Apr 2002 | new search | results | previous | next |
a reg-exp assist - jsby "Michael Gerholdt" <gerholdt(at)fredonia.edu> |
|
re = /\$/g; r2 = /,/g; I can get these to work independently, but how can I combine them into one pattern in JS? I would think re = /\$,/g; a = $40,000; a = a.replace(re,""); so a = 40000 in the end. but I get NAN when I try this. In the meantime, I'm doing: re = /\$/g; r2 = /,/g; a = a.replace(re,""); a = a.replace(r2,""); which yields the correct results .. but surely this is not necessary! Thanks, Mike
HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA