正则表达式 – 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

相关文章

正则替换html代码中img标签的src值在开发富文本信息在移动端...
正则表达式
AWK是一种处理文本文件的语言,是一个强大的文件分析工具。它...
正则表达式是特殊的字符序列,利用事先定义好的特定字符以及...
Python界一名小学生,热心分享编程学习。
收集整理每周优质开发者内容,包括、、等方面。每周五定期发...