<?php
$string =
'<ul>
<li>
<a href="/nalcrom">Nalcrom</a>
(Sodium Cromoglicate)
</li>
<li>
<a href="/alimemazine">Alimemazine</a>
</li>
<li>
<a href="/xolair">Xolair</a>
(Omalizumab)
</li>
</ul>';
preg_match_all('%">(.*?)</a>\s+(\(.*?\))?%i', $string, $match, PREG_PATTERN_ORDER
); for ($i = 0; $i < count($match[0]); $i++) { echo $match[1][$i] . " ". $match[2][$i] ."\n";
}
PD9waHAKCiRzdHJpbmcgPQonPHVsPgo8bGk+CjxhIGhyZWY9Ii9uYWxjcm9tIj5OYWxjcm9tPC9hPgogICAgICAgIChTb2RpdW0gQ3JvbW9nbGljYXRlKQo8L2xpPgo8bGk+CjxhIGhyZWY9Ii9hbGltZW1hemluZSI+QWxpbWVtYXppbmU8L2E+CjwvbGk+CjxsaT4KPGEgaHJlZj0iL3hvbGFpciI+WG9sYWlyPC9hPgogICAgICAgIChPbWFsaXp1bWFiKQo8L2xpPgo8L3VsPic7CgpwcmVnX21hdGNoX2FsbCgnJSI+KC4qPyk8L2E+XHMrKFwoLio/XCkpPyVpJywgJHN0cmluZywgJG1hdGNoLCBQUkVHX1BBVFRFUk5fT1JERVIpOwpmb3IgKCRpID0gMDsgJGkgPCBjb3VudCgkbWF0Y2hbMF0pOyAkaSsrKSB7CiAgICBlY2hvICAkbWF0Y2hbMV1bJGldIC4gIiAiLiAkbWF0Y2hbMl1bJGldIC4iXG4iOwp9