- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$str = '#TAGLIST_<a href="search.php?tag={TAG}">{TAG}</a>&nbsp;# <br>';
preg_match("/TAGLIST_<a\s*href\s*=\s*"(.*)">/ims", $str, $matches);
print_r($matches);