$re = '/[\*\s]*@(?P<name>\w+[\\\\\w]*?)(?:\s|\()
(?P<value>
(?:[\/\w\s\"\<\>\_\#\=\-\.\'\{\}:;,\*\(\)\[\]]*[^\R\*\s\/\)])
)?
(?:\s | $|\))/sxmu';
$str = '/**
* Description
*
* @Tag name name @annotation beee @aaf dsfsd fgdg
* @Tag name name {"json":"dfsf"} (sad)
* @Tag asdasd <html> #markdown ==markdown== __markdown__
* - markdown
* > mark 1
.mark
"string"
\'string\'
* @Annotation()
* @Tag name name @annotation beee @aaf dsfsd fgdg <markdown> #markdown ==markdown==
* @a() @b("name") @c()
* @Annotation\\Name("var1()", "var2") @n("name()_name")
* @Annotation(["var1", "var2"], "var3")
* @Annotation\\Filter\\Name(["var1", "var2"], "var3", {"var4": "var5"})
* @Annotation(
* ["GET", "POST"]
) @Name({"name": "Tomas"})
* @Tag name name
*/';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php