I have the following code:
$str_val = \"L(ine 1( L(ine 2) Line 3 Line 4)\"; $regex = \'/\\(([^\\)]*?)\\)/i\'; preg_match($regex, $str_val, $match
You can use this: -
'/\((.*)\)/s'
/s modifier is used to enable the dot metacharacter to match everything including a newline. And, since .* is a greedy quantifier, it will match the longest string possible. So, it will match till the last ).
/s
.*
)