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!

Tab Space in REGEXP_SUBSTR

no data foundJul 8 2016 — edited Jul 9 2016

Hi all,

I want to select the substring of a string that are separated by tab spaces, most importantly if the there are two tab spaces together then the null value should be selected for that occurrence.

Kindly help with regexp_substr to achieve this.

For example -

If the string is l_string := "This     is     an          example     string"

I want to use regexp_substr in such a way as explained below to select based on the occurrence of tab spaces

var1 = This

var2 = is

var3 = an

var4 = NULL (This is NULL because there are two tab spaces in the above string)

var5 = example

var6 = string

I've used the below code but it doesn't help, it considers two tab spaces as single one and ignores the null value

REGEXP_SUBSTR (l_string,

                              '[^' || CHR (9) || ']+',

                              1,

                              1)

Thanks!

This post has been answered by Frank Kulash on Jul 8 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2016
Added on Jul 8 2016
5 comments
3,271 views