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

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -