Skip to Main Content

Oracle Database Discussions

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!

Split String into words including Termiators

user13074471Nov 22 2015 — edited Nov 23 2015

My requirement is to split string into words, including terminators (space,comma,semicolon,new line) etc

Words and Terminatorsalso should also come in output ?

How can I achieve that?

Query

select regexp_substr('testto ,mm\;' || '

     string into words',

     '\w+',1,level) from dual

     connect by level <= regexp_count('testto,mm\;' || '

     string into words

     ','\w+')

Desired Output

1 testto

2  

3 ,

4 mm

5 ;

6 string

7  

8 into

9  

10 words

Currently it is skipping the terminators.

Can somebody help?

Thanks

Sree

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2015
Added on Nov 22 2015
4 comments
815 views