I am trying to capture a string but ran into a problem
This is how the string always is:
x (stuff here),
x = any chars and any amount
now it works with the pattern before but the problem occures when (stuff here) has another string inside it with "space(" as seen below, any way to fix this?
$pattern = "/(.+) \(.+\)\,/";
$line = "bob (xx ()xx),";
preg_match($pattern, $line, $matches);
var_dump($matches);
matches[2] =
"bob (xx"
p.s.: I am just trying to get the "x" part, and before going to php to do the work i would like to see if there is a better way to do my reg expression