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!

Matching ( in a string

user8492264Jan 18 2017 — edited Feb 5 2017

Hi,

Let's suppose I have a string

str := ' ((Hello ( Hi Hi hi ( A B C ( D)) (EF)

why Whwy whyhhh )

)

)'

Now I need to find the matching bracket position for the 3rd bracket. Is their a way we can do the same using SQL.

in PL SQL I can do the same using +1,-1 logic, say start from the position of 3rd bracket, keep adding 1 for ( and - 1 for ) and wait till 0. But is there any other better way. maybe regex or something.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 5 2017
Added on Jan 18 2017
22 comments
2,168 views