0
我遇到查詢問題。我使用MySQL作爲數據庫。我想用一個REGEX
的結果我預期匹配,並且表是:在mysql中匹配正則表達式失敗
table A
-----------------------------------------------
| ID | Description |
-----------------------------------------------
| 1 | 29th Marine Regiment/1st Bn (1/29) |
| 2 | new 21 new 2 new |
| 3 | new 2th 2 (2/2) |
| 4 | 2new 2new (2/2) |
| 5 | new2 new 2new |
結果我需要得到:
-----------------------------------------------
| ID | Description |
-----------------------------------------------
| 1 | 29th Marine Regiment/1st Bn (1/29) |
我對正則表達式正確的結果
^(29[^0-9]+)[^0-9]+1[^0-9]+\([a-zA-Z0-9/-]*\)\s*$
in http://www.regexr.com/但我沒有在MySQL中得到結果。
http://sqlfiddle.com/#!2/7bd4b/2
有誰知道這是如何發生的?
修剪你的正則表達式來什麼,我認爲* *你希望它是我得到這個工作之一:'「^ 29 [^ 0-9] +1 [^ 0-9] + \\([a-zA-Z0-9/- ] * \\)\\ s * $''請注意'\\'s。 – Biffen 2014-09-03 06:34:34
thanks..it works – muhnizar 2014-09-03 06:46:00
[here](http://stackoverflow.com/q/25615003/1578604)上的任何更新? – Jerry 2014-09-03 06:49:29