in reply to How to use regex to get brackets surrounding something

Is your data a string? Where does it come from?

There's probably a better way to accomplish what your main goal is. If you describe your situation a little more fully you'll probably get some good suggestions.

XY Problem


The way forward always starts with a minimal test.
  • Comment on Re: How to use regex to get brackets surrounding something