Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个在 PHP 中有效的正则表达式,但不是 MySQL REGEXP 函数。
'(.)\1{2,}'
在 PHP 中,这匹配任何重复 2 次或更多次的字符,我如何将其翻译为与 MySQL 函数一起使用。
对不起,你不能。MySQL 使用不支持反向引用的 POSIX 正则表达式。如果必须在 MySQL 中执行此类匹配,则唯一的选择是安装 UDF,例如lib_mysqludf_preg。