Regular expression to remove second couple of parenthesis (only when available)

Posted by Jonathan on Stack Overflow See other posts from Stack Overflow or by Jonathan
Published on 2010-05-19T15:58:33Z Indexed on 2010/05/19 16:00 UTC
Read the original article Hit count: 408

Filed under:
|

Hi, 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!

© Stack Overflow or respective owner

Related posts about php

Related posts about regex