PHP function to escape MySQL regexp syntax

后端 未结 5 1644
自闭症患者
自闭症患者 2020-12-20 12:39

I\'m looking for something similar to preg_quote, but for the MySQL regexp syntax.

Any ideas?

5条回答
  •  心在旅途
    2020-12-20 13:03

    Sadly, PHP's preg_quote() messes up MySQL REGEXP by escaping a colon sign (:) which MySQL's REGEXP does not understand

提交回复
热议问题