My current regex matches a function name and the variable name passed to the function see here
Regex - (file_exists|is_file)\(([^)]+)
string if (is_file($file)){
Matches is_file
and $file
I would also like the regex to work with a string rather than just a variable name, This includes strings with multiple opening and closing brackets.
Here's an extreme example.
Regex - (file_exists|is_file)\(????????)
string if (is_file(str_replace(array('olddir'), array('newdir'), strtolower($file))){
Matches is_file
and str_replace(array('olddir'), array('newdir'), strtolower($file)
Is there a way to match the next closing bracket, unless one has been opened?
I would like to get it working at regex101