Regex 正则表达式仅匹配货币中的数字
我试图让VB正则表达式只匹配货币序列中的数字,如果可能的话,不需要额外的替换行。它需要寻找一个带有+端的数字,在开始时返回中间的,减去逗号。< /P> 相应地Regex 正则表达式仅匹配货币中的数字,regex,vb.net,Regex,Vb.net,我试图让VB正则表达式只匹配货币序列中的数字,如果可能的话,不需要额外的替换行。它需要寻找一个带有+端的数字,在开始时返回中间的,减去逗号。< /P> 相应地 $10,000+ match returns 10000 $20,000+ match returns 20000 $30,000+ match returns 30000 $1,000,000+ match returns 1000000 $10,000 (anything without the trailing +) sh
$10,000+ match returns 10000
$20,000+ match returns 20000
$30,000+ match returns 30000
$1,000,000+ match returns 1000000
$10,000 (anything without the trailing +) should *not* match
我可以很容易地获得与值的匹配,但我不知道如何去掉尾随+或前缀和逗号。您的正则表达式是\$(\d+(,?\d+*)\+
。第一组就是您要找的检查 检索结果后,应删除其中的逗号