0

I have one string which contains multiple parenthesis: Like this:

(This) (is a (test)) string, (Testing) should be (done (here)).

I have already tried some regex which I have found on the net. But as I am not so familiar with regex. Help is needed.

I have tried this:

$text = '(This) (is a (test)) string, (Testing) should be (done (here)).';
preg_match_all("/\([^\)]*\)/", $text, $matches);

You can have a look at this: https://regex101.com/r/8QCwOP/1

And I want result like this

  1. This
  2. is a (test)
  3. Testing
  4. done (here)
Barmar
  • 596,455
  • 48
  • 393
  • 495
  • Hi @Barmar, can you please let me know where that duplicate question is, as I have searched and got few links which I have already been tried. A little help would be great. – Rushikesh Oza Jun 25 '19 at 04:44
  • The link is at the top, where it says "The question already has an answer here". – Barmar Jun 25 '19 at 16:35

0 Answers0