1

I have a column COL1 that contain different languages english ,arabic

  col  col1
  __  __
  1  information
  2  معلومات

I am searching for a query to get me only the arabic character

 col  col1
  __  __
  2  معلومات

I found a link that use function REGEXP_LIKE that get only digits, is there a way that I can get the arabic ?

edit

I did this 
   and o.col1 not like ('%A%')
   and o.col1 not like ('%B%')
   and o.col1 not like ('%C%')
   and o.col1 not like ('%D%')
   and o.col1 not like ('%E%')
   and o.col1 not like ('%F%')
   and o.col1 not like ('%G%')
   and o.col1 not like ('%H%')
   and o.col1 not like ('%I%')
   and o.col1 not like ('%J%')
   and o.col1 not like ('%K%')
   and o.col1 not like ('%L%')
   and o.col1 not like ('%M%')
   and o.col1 not like ('%N%')
   and o.col1 not like ('%O%')
   and o.col1 not like ('%P%')
   and o.col1 not like ('%Q%')
   and o.col1 not like ('%R%')
   and o.col1 not like ('%S%')
   and o.col1 not like ('%T%')
   and o.col1 not like ('%U%')
   and o.col1 not like ('%V%')
   and o.col1 not like ('%W%')
   and o.col1 not like ('%X%')
   and o.col1 not like ('%Y%')
   and o.col1 not like ('%Z%')
Community
  • 1
  • 1
Moudiz
  • 7,211
  • 22
  • 78
  • 156
  • check this post http://stackoverflow.com/questions/15107313/how-to-determine-a-string-is-english-or-arabic and create a procedure to call the method there within your SGBD :) – mounaim Oct 01 '14 at 12:40

1 Answers1

1

REGEXP_LIKE syntax allows searching for characters within a range like [A-Z]. Inspired by the link given in the comment by @mounaim, it is possible to let REGEXP_LIKE search for the Unicode range 0600-06FF with this REGEXP_LIKE syntax:

select *
  from tab
 where regexp_like(col1, UNISTR('[\0600-\06FF]'))

If you need to search for more than the basic Arabic Unicode range ( http://en.wikipedia.org/wiki/Arabic_alphabet#Unicode ), it can be expanded like:

select *
  from tab
 where regexp_like(col1, UNISTR('[\0600-\06FF]|[\0750-\077F]|[\08A0-\08FF]|[\FB50-\FDFF]|[\FE70-\FEFF]'))

The | here is the REGEXP OR operator so that will search for a character in the first range OR the second range OR etc...

The 5-hex-digit Unicode ranges I have no idea how to search for, but I hazard the guess that they are very rarely used ;-)

Kim Berg Hansen
  • 1,979
  • 12
  • 12