0

The .replace() function I'm currently using is str.replace(/ *\([^)]*\) */g, ' ').replace(/ *\[[^)]* */g, ' ')

However, this doesn't works when there are nested parenthesis and brackets. For examples if str was (something something (something)), the replace statements would return ')' instead of a blank string. Is there anyway to get rid of all content inside nested parentheses?

Bubblebyb
  • 33
  • 2

0 Answers0