2

I would like to find all special characters which are used in 'mytable' > column 'name'

SELECT name 
FROM mytable 
WHERE name regexp '[^a-zA-Z0-9]'

But I would like to receive results which will not show whole 'name' data, but only this special character used in the column 'name'. How can I do it?

suz
  • 737
  • 2
  • 9
  • 22
  • 1
    Bad news: there's no replace by regex in MySQL. So, use `REPLACE()` 26*2+10 times. Yes, it's horrible - so, yes, don't use DBMS for that, use your application – Alma Do Apr 01 '14 at 13:41
  • 1
    Check this package: https://github.com/hholzgra/mysql-udf-regexp – Grijesh Chauhan Apr 01 '14 at 13:41
  • 1
    Duplicate of [MySQL - Return matching pattern in REGEXP query](http://stackoverflow.com/questions/5361457/mysql-return-matching-pattern-in-regexp-query). – blue Apr 01 '14 at 13:41
  • Check this post [How to do a regular expression replace in MySQL?](http://stackoverflow.com/q/986826/1673391) – Grijesh Chauhan Apr 01 '14 at 13:43
  • Ok, thanks. Just to be sure: I do not need to change (replace) special characters. I just want to receive the list of all special characters used in database – suz Apr 01 '14 at 13:55

0 Answers0