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这个位置反了吧,第一行语法中

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!