I have a data looking like :
$data = (E,(A,B),(C,D),F)
When searching for a character, I need all the characters in the searched character bracket. and remove it from $data.
Eg : If searching for E,
$data = (A,B),(C,D)
$output = (E,F)
Is there any regex for it?