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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -