2014-12-02 21 views
0

我在使用正則表達式從我的MySQL表中選擇一些結果時遇到了問題。 我使用這個查詢MYSQL#1139 - 從regexp得到錯誤'重複運算符操作數無效'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

好像你需要躲避+兩次:

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