Removing non-alphaNumerics in MySQL

后端 未结 5 554
既然无缘
既然无缘 2021-01-14 07:27

Do you know any easy way to remove (or replace) all non alphanumeric characters from varchar variable in Mysql?

something like String\'s replaceAll(\"[^a-zA-Z0-9]\",

5条回答
  •  Happy的楠姐
    2021-01-14 08:00

    It appears that MySQL doesn't provide this functionality (unlike PostgreSQL), according to the docs of RegexBuddy:

    MySQL's support for regular expressions is rather limited, but still very useful. MySQL only has one operator that allows you to work with regular expressions. This is the REGEXP operator, which works just like the LIKE operator, except that instead of using the _ and % wildcards, it uses a POSIX Extended Regular Expression (ERE).

提交回复
热议问题