Solved

SQL parse parens and contents in between

Posted on 2011-03-07
4
297 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now