Detecting a parenthesis pattern in a string
This is a line (an example between parenthesis).
or
This is a line(an example between parenthesis).
I need to separate both strings in:
$text = 'This is a line.';
$eg = 'an example between parenthesis';
I have this code so far:
$text = 'This is a line (an example between parenthesis)';
preg_match('/\((.*?)\)/', $text, $match);
print $match[1];
But it only brings the text inside the parenthesis. I also need the text outside the parenthesis.