Solved

SQL parse parens and contents in between

Posted on 2011-03-07
4
302 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
  • 2
4 Comments
 
LVL 73

Expert Comment

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

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 73

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

831 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