0

I'm trying to find all non-asci characters I have in my DB in a specific table and column. In that column are stored Html description, and in some of them I've exotic or non-existing characters (for example: Hà¶ganà¤s ).

I'm triyng to match them with this query:

SELECT * FROM project_version WHERE description REGEXP '[^()\x00-\xFF\,\.-\<\>="\' /:;&=]'

But I think I'm missing something, cause it returns all of my records. Does anyone any advice?

Thanks in advance

2
  • There's a similar question here that has multiple answers; this answer may be the best - it was added much later so it doesn't have as many upvotes, but it looks solid. Commented Oct 1, 2013 at 14:34
  • 1
    ASCII is actually only 0x00-0x7F, so [^\x00-\x7F] or [\x80-\xFF] will do it. Commented Oct 1, 2013 at 14:34

1 Answer 1

0

Try moving hyphen to start or end otherwise it needs to be escaped also ^ will be treated as literal ^ in character class:

SELECT * FROM project_version WHERE description REGEXP '[()\x00-\x7F,.<>="\' /:;&=-]'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.