$text = '[This] is a [test] string, [eat] my [shorts].'; preg_match_all("/\[[^\]]*\]/", $text, $matches); var_dump($matches[0]);
$text = '[This] is a [test] string, [eat] my [shorts].'; preg_match_all("/\\title{[^\]]*\}/", $text, $matches); var_dump($matches[0]);
$text = 'This is testing \title{string} with \title{test} tags.'; preg_match_all('/\\\title\{([\w]+)\}/', $text, $matches); var_dump($matches);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)