MySQL REGEXP query - accent insensitive search

前端 未结 7 1927
清歌不尽
清歌不尽 2020-12-19 00:46

I\'m looking to query a database of wine names, many of which contain accents (but not in a uniform way, and so similar wines may be entered with or without accents)

7条回答
  •  旧巷少年郎
    2020-12-19 01:00

    Because REGEXP and RLIKE are byte oriented, have you tried:

    SELECT 'Faugères' REGEXP 'Faug(e|è|ê|é|ë)r(e|è|ê|é|ë)s';
    

    This says one of these has to be in the expression. Notice that I haven't used the plus(+) because that means ONE OR MORE. Since you only want one you should not use the plus.

提交回复
热议问题