I have something like this:
$arr[] = 'Seto Hakashima'
$arr[] = 'Anna (segment "Yvan Attal") (as Robin Wright Penn)'
$arr[] = 'Sara (segment "Yvan Attal")'
I need to remove the the second couple of parenthesis (only when there is a second couple), and get this:
$arr[] = 'Seto Hakashima'
$arr[] = 'Anna (segment "Yvan Attal")'
$arr[] = 'Sara (segment "Yvan Attal")'
Thanks!
This works:
Output:
As you’ll notice in the last example, this regex is specific enough that it eliminates only the second group of parenthesis and keeps the rest of the string in tact.