php - 从正则表达式中得到错误 'repetition-operator operand invalid' - mysql

标签 php mysql regex

当我尝试在 sql 中使用以下正则表达式时出现错误。

 [0-9]{10,}|(?:[\+\(]|1\-)\s*[0-9]+([ \.\(\)\-/x]+[0-9]{2,})+[0-9]

请让我知道我在这方面犯的错误。

我得到的错误是,

1139 Got error 'repetition-operator operand invalid' from regexp

最佳答案

查看错误 http://bugs.mysql.com/bug.php?id=399

\+ 被视为重复运算符 所以这也失败了:

mysql> select 'fred' regexp('?[\+]'); 
ERROR 1139 (42000): Got error 'repetition-operator operand invalid' from regexp

关于php - 从正则表达式中得到错误 'repetition-operator operand invalid' - mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15353622/

相关文章:

php - 在进行 == 和 === 比较时,变量的顺序是否重要?

php - 如何从复选框中插入多个值并将其插入mysql

mysql - 查询以查找同一张表中的差异

javascript - Angular 中的正则表达式通配符

javascript - 使用正则表达式将 ID 与字符串分离

c# - 使用特殊字符时出现解析错误

javascript - 在警报消息后使用 PHP 重定向到 HTML 页面

PHP从mysql中获取数组中的多个数据

php - 如何获取给定城市/国家的经度/纬度?

MySQL CROSSTAB 或 PIVOT 查询