【问题标题】:MYSQL #1139 - Got error 'repetition-operator operand invalid' from regexp MYSQLMYSQL #1139 - 从正则表达式 MYSQL 中得到错误“重复运算符操作数无效”
【发布时间】:2015-01-31 07:39:24
【问题描述】:

我无法使用正则表达式从我的 MySQL 表中选择一些结果。 我正在使用这个查询

select t.City, t.Mall, t.Number_Phone,  t.Number_Phone rlike '^((\+380){1}(\(542\)){1}[0-9]{6}){1}&' as test from (select c.name as City, m.name as Mall, p.text_value as Number_Phone from objects c cross join objects m left join params p on (m.object_id=p.object_id and p.attr_id=11) where (c.object_type_id=23 and m.object_type_id=25)) as t

它说

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

正则表达式:

'^((\+380){1}(\(542\)){1}[0-9]{6}){1}&'

提前谢谢你。

【问题讨论】:

    标签: mysql regex


    【解决方案1】:

    您似乎需要两次转义+

    '^((\\+380){1}(\(542\)){1}[0-9]{6}){1}&'
    

    【讨论】:

      猜你喜欢
      • 2013-08-21
      • 2013-02-27
      • 2014-05-04
      • 2016-09-09
      • 2019-12-11
      • 2014-07-27
      • 2015-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多