如何使用正则表达式删除美元格式 [英] How to remove dollar format with regex

查看:73
本文介绍了如何使用正则表达式删除美元格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从字符串 $ 1,109,889.23中删除美元格式。我尝试使用带有以下内容的正则表达式:

I am trying to remove the dollar format from the string '$1,109,889.23'. I tried using a regular expression with:

"[^\\d]" 

但是我得到了逗号。

有什么帮助吗?

推荐答案

我正在使用ColdFusion。

I am using ColdFusion. The [^\d.] works great as eldarerathis mentioned above.

   <cfset amt = '$1,109,889.23'>
   <cfset newAmt = ReReplace(amt, "[^\d.]", "","ALL") >
   <cfoutput>#newAmt#</cfoutput>

这篇关于如何使用正则表达式删除美元格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆