正则表达式 – ColdFusion中的正则表达式

前端之家收集整理的这篇文章主要介绍了正则表达式 – ColdFusion中的正则表达式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使用rereplace修剪前导零和尾随零?

它与插入符号,星号和美元符号有关.

一个0.

这是一个备忘单:
http://www.petefreitag.com/cheatsheets/regex/

解决方法

reReplace(string,"^0*(.*?)0*$","$1","ALL")

那是:

^ = starting with
0* = the character "0",zero or more times
() = capture group,referenced later as $1
.* = any character,zero or more times
*? = zero or more,but lazy matching; try not to match the next character
0* = the character "0",zero or more times,this time at the end
$= end of the string

猜你在找的正则表达式相关文章