I am trying to find a php preg_match that can match
test1 test2[...] but not test1 test2 [...]
and return test2(...) as the output as $match.
I tried
preg_match('/^[a-zA-Z0-9][\[](.*)[\]]$/i',"test1 test2[...]", $matches);
But it matches both cases and return the full sentence.
Any help appreciated.