-1

i am trying to find a alphanumeric value in a column, which is case sensitive.
I tried this pattern, but it is not working.

`REGEXP_LIKE ('1000 - 2000 test', '^[0-9]{4} - [0-9]{4} test', 'c')`

Or does case sensitive not work for alphanumeric values?

Eli
  • 19
  • 1
  • 5
  • 2
    What do you mean with "not working"? Does this return false? – Aleksej Apr 13 '16 at 13:47
  • No values were returned at first. But It was my fault since there was a blank space in the statement and i have removed it and corrected it. Now it gives me a value. Sorry for the inconvenience. – Eli Apr 13 '16 at 14:01

1 Answers1

0

Read the manual http://docs.oracle.com/cd/B12037_01/server.101/b10759/conditions018.htm ;)

 select * from (
           select '1000 - 2000 test' a from dual
 union all select '1000 - 2123 TEST' a from dual
) where
REGEXP_LIKE(a, '^[0-9]{4} - [0-9]{4} test', 'c');

Returning

1000 - 2000 test

is case sensitive because of 'c', thus the above gives 1 row whereas below, using 'i' case insensitive, gives 2:

 select * from (
           select '1000 - 2000 test' a from dual
 union all select '1000 - 2123 TEST' a from dual
) where
REGEXP_LIKE(a, '^[0-9]{4} - [0-9]{4} test', 'i');

Returning

1000 - 2000 test
1000 - 2123 TEST
Aleksej
  • 22,443
  • 5
  • 33
  • 38
J. Chomel
  • 8,193
  • 15
  • 41
  • 69