Solved

SQL parse parens and contents in between

Posted on 2011-03-07
4
308 Views
Last Modified: 2012-05-11
Looking to strip out parenthesis (and contents) in a product's description.

For example:

IS:
Chocolate 0.6m (1.96 ft.) Braided

MAKE:
Chocolate Braided

would also like to strip out the "0.6m" if possible too.

Any ideas?
0
Comment
Question by:globalwm2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 35060314
regexp_replace(yourstring,' ?\([^)]+\)')
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35060315
Is it always first and last word?

What are some of the other terms that need stripped?

More sample data and expected results would help a lot.
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 125 total points
ID: 35060338
oops, missed the "also" part

how is that identified?  the word immediately preceeding the parenthentic section?

if so, try this...

regexp_replace(yourstring,' .+ \([^)]+\)')

if that's not the rule, please explain how to identify which pieces of your string stay and which are removed
0
 

Author Closing Comment

by:globalwm2
ID: 35060577
Thanks - I can work with this for my needs.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question