我在使用正则表达式从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
常规exp:
'^((\+380){1}(\(542\)){1}[0-9]{6}){1}&'
提前谢谢。
答案 0 :(得分:0)
您似乎需要两次逃离+
:
'^((\\+380){1}(\(542\)){1}[0-9]{6}){1}&'