$re = '/(>([A-Z ]+?)<|title="([\d-]+))/m';
$str = '<a href="http://rs.xidian.edu.cn/forum.php?mod=viewthread&tid=662128&extra=page%3D1" onclick="atarget(this)" class="s xst">GIRL FRIENDS</a>
<span class="tps"> ...<a href="http://rs.xidian.edu.cn/forum.php?mod=viewthread&tid=662128&extra=page%3D1&page=2">2</a></span>
<a href="http://rs.xidian.edu.cn/forum.php?mod=redirect&tid=662128&goto=lastpost#lastpost" class="xi1">New</a>
</th>
<td class="by">
<cite>
<a href="http://rs.xidian.edu.cn/home.php?mod=space&uid=265770" c="1">机器人</a></cite>
<em><span><span title="2014-7-31">昨天 23:55</span></span></em>
</td>';
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