从regexp - mysql获得错误'重复 - 操作符操作数无效'

时间:2013-03-12 04:57:35

标签: php mysql regex

当我尝试在sql中使用以下regexp时,我收到错误。

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

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

我得到的错误是,

  

1139从regexp

获得错误'重复 - 运算符操作数无效'

1 个答案:

答案 0 :(得分:3)

请参阅错误http://bugs.mysql.com/bug.php?id=399

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

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