Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

regexp_substr sub_expression value greater than 9 - 12C

PabloC2Jul 20 2016 — edited Jul 20 2016

Hello,

I have a specific string with more than 9 regex capture groups. When I apply the regexp_substr function and set the sub_expression value to 10 or higher, it always returns null. Here is the question: Is it possible to have more than 9 capture groups in Oracle regular expression when applying the regexp_substr function?.

Example: The following regular expression function will return the 9th capture group, in this case the letter "l"

SELECT REGEXP_SUBSTR('helloworld','(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})',1,1,NULL,9) FROM DUAL;

If I want to extract the letter "d", which is group 10, the function returns null

SELECT REGEXP_SUBSTR('helloworld','(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})(.{1})',1,1,NULL,10) FROM DUAL;


Can someone please clarify this?


Thanks.


Pablo C.

This post has been answered by John Stegeman on Jul 20 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2016
Added on Jul 20 2016
4 comments
1,042 views