There may be a better way to do this, but here is what I came up with:
SELECT title FROM tags WHERE title REGEXP CONCAT('[',CHAR(1),'-',CHAR(31),']')
Note that these are decimal values โโof characters, not hex. I also could not figure out how to make it find NULL bytes ( \x00
).
Here is an alternative that uses hexadecimal literals:
SELECT title FROM tags WHERE title REGEXP CONCAT('[', x'01', '-', x'1F', ']')
source share