regex - ColdFusion 中的正则表达式

标签 regex coldfusion

如何使用替换修剪前导零和尾随零?

它与插入符号、星号和美元符号有关。

和一个 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

关于regex - ColdFusion 中的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4671274/

相关文章:

python - 检查字符串是否不是反序列化的 json 或 python 中的列表

mysql - 希望通过 MYSQL 提取字符串中括号之间的数据

python - "raw string regex"究竟是什么,你如何使用它?

xcode - Phonegap 使用 Coldfusion 作为后端来检索数据

javascript - ColdFusion 为 ajax 调用 CFC 页面

regex - 正则表达式不从 3 行返回第一个数字

java - codingBat repeatEnd 使用正则表达式

java - 从 Java 共享或发送复杂数据到 Coldfusion

java - 从 ColdFusion 调用 .jar

coldfusion - 从 html 片段中提取内容