MySQL 正则表达式:regexp_substr 函数 0 个改进

MySQL regexp_substr() 函数用于模式匹配。它从给定的字符串中返回子字符串。

语法#

select regexp_substr('str', 'match_type', occurrence, position, );  

示例 1#

select regexp_substr('java t point', '[a-z]+', 2, 3);  

输出:

MySQL regexp_substr Function

示例 2#

select regexp_substr('my sql function', '[a-z]+', 1, 3);  

输出:

MySQL regexp_substr Function

本文为 Wiki 文章,邀您参与纠错、纰漏和优化
讨论数量: 2

'wo1 我🙈녕하? 们?おは的 dege 張、' 有什么办法只把里面的中文提取出来?\u4e00-\u9fa5 不管用

3年前 评论

occurrence, position 这个位置反了吧,第一行语法中

3年前 评论