我有一個表access_rules與列路徑。 我在表中添加一行:MySQL的正則表達式行爲
INSERT INTO access_rules (path) VALUES ('/user/search/*'), ('/user'), ('/someotherpath')
現在,我執行查詢:
SELECT * FROM `access_rules` where '/user/search/ddd' regexp path
我想回/用戶/搜索/ *,但查詢同時返回'/user/search/*'
和'/user'
。 有人可以告訴我爲什麼這樣嗎?
我想如果你在'path'中有'/ search',它也會返回。 – hjpotter92