Created
June 11, 2021 08:35
-
-
Save JoJoJotarou/1544393180d40761968443764a07f511 to your computer and use it in GitHub Desktop.
mysql 正则表达式
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mysql取字符串中的数值(小数据需要保留) | |
# 正常写法:(?!\.)\D | |
# 解释:取出所有非数字的字符,不包括小数点 | |
select regexp_replace('(12.0 -&dd放大21)', '(?!\\\.)\\D', '') | |
# 结果:12.021 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment