• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

SQL parse parens and contents in between

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
globalwm2
Asked:
globalwm2
  • 2
1 Solution
 
sdstuberCommented:
regexp_replace(yourstring,' ?\([^)]+\)')
0
 
slightwv (䄆 Netminder) Commented:
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
 
sdstuberCommented:
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
 
globalwm2Author Commented:
Thanks - I can work with this for my needs.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now