加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 05:46:33 所属栏目:百科 来源:网络整理
导读:如何使用rereplace修剪前导零和尾随零? 它与插入符号,星号和美元符号有关. 一个0. 这是一个备忘单: http://www.petefreitag.com/cheatsheets/regex/ 解决方法 reReplace(string,"^0*(.*?)0*$","$1","ALL") 那是: ^ = starting with0* = the character "0"
如何使用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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读