oracle11g - Oracle regular expression using hyphen in pattern -


why query returning value 4 (i expected 0)?

select  regexp_instr ('123abc','[a-z]') dual; 

i think [] should indicate character list, , a-z includes upper letters?

this affected session's nls_sort setting, , result of 4 if have case-insensitive sorting enabled:

alter session set nls_sort=binary; select  regexp_instr ('123abc','[a-z]') dual;  regexp_instr('123abc','[a-z]') ------------------------------                              0  alter session set nls_sort=binary_ci; select  regexp_instr ('123abc','[a-z]') dual;  regexp_instr('123abc','[a-z]') ------------------------------                              4 

you can read more in documentation; , may find this answer useful too.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -