3

I just want to display data with :

  1. containing a-z

  2. containing A-Z
  3. contain numbers 0-9
  4. contain printable ASCII charachter on the following link http://www.theasciicode.com.ar/extended-ascii-code/latin-diphthong-ae-uppercase-ascii-code-146.html

I stuck using code like this, please help point -4 above:

select * from Delin where the address REGEXP '^ [A-Za-z0-9]'

with sample raw data below:

enter image description here

and i wanna output like this(where these images show a-Z and only printable symbols) :

enter image description here

Jordan Running
  • 102,619
  • 17
  • 182
  • 182
Delinda Dyta
  • 187
  • 1
  • 2
  • 12
  • 1
    [This SO question](http://stackoverflow.com/questions/401771/how-can-i-find-non-ascii-characters-in-mysql) appears to be a duplicate, except that non of the methods specified there will work in your case, because you want extended ASCII. A major limitation is that MySQL does not appear to have a built-in extended ASCII character set. – Tim Biegeleisen Nov 23 '16 at 06:20

1 Answers1

2

Your items 1–3 (az, AZ, and 09) are all subsets of item 4 (printable ASCII characters), so you need only concern yourself with the latter. The following query satisfies that criterion:

SELECT * FROM Delin
 WHERE alamat REGEXP '^[ -~]+$';

The character class [ -~], indicates the ASCII characters from space to tilde inclusive, which happens to be all of the printable ASCII characters and no others.

You can see it in an SQL Fiddle here: http://sqlfiddle.com/#!9/6c7b8/1

Terminology note: There is no such thing as "Extended ASCII." The ASCII character set corresponds to the numbers 0–127 inclusive. Any character corresponding to a number greater than 127 is not ASCII. The term "Extended ASCII" is often mistakenly applied to various non-ASCII encodings, none of which is an "extension" of ASCII in any official sense.

Jordan Running
  • 102,619
  • 17
  • 182
  • 182