本文介绍了RegEx:在字符串末尾找到零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在字符串末尾查找零的正则表达式是什么?
What is a regEx to find a zero at the end of a string?
例如,我希望它找到 32.20 中的 0,而不是 302.2 中的 0
For instance, I want it to find the 0 in 32.20, but not the 0 in 302.2
谢谢!
推荐答案
如果要匹配 30.1 中的零,则为 0(?=\.|$)
.否则,它只是 0$
If you want to match the zero in 30.1, it’s 0(?=\.|$)
. Else, it’s just 0$
这篇关于RegEx:在字符串末尾找到零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!