<body>
最终匹配到2499.00,正则该怎么样写;
搞gaodaima代码
回复内容:
<body>
最终匹配到2499.00,正则该怎么样写;
直接这样可以吗 substr("¥2499.00",3);
<code>("¥2,499,999.00").replace("¥","").replace(/,/g,"");("¥499,999.00").replace(/[^\d\.]/g,"");</code>
<code>"¥2,499.00".match(/¥([\d,]*?\.00)/)[1]//2499.00"¥2,99.00".match(/¥([\d,]*?\.00)/)[1]//299</code>
<code>var str='¥2,499.00';str.replace(/[¥,]/g,''); // => 2499.00</code>
<code>var str = '$2,499.00';str.match(/[\d.]/g).join('');</code>
如果字符串里面还有其他的字符,这样就可以了