hi all i have this regex pattern: if(preg_match_all("/[(showthread.php\?t=(.*?)[\"\&])(t(.*?)\.html)]/", $search_topics, $topics_array)) PHP: it simply should grab all topic numbers(ids) from any page i choose from different types of VBulletin boards.. anyway, letme break it for u: some VB boards use this method to show topics: showthread.php?t=xxxxxxx and others use this method: t40190.html as u can see topic ID is merged with html file.. my regex worx for first type only, i tried to make 1 pattern to match both links. [(showthread.php\?t=(.*?)[\"\&]) <-- used for first method and it works perfectly (t(.*?)\.html) <-- its not working] any help would be appreciated....
Here's your solution: if (preg_match_all('/(?:showthread\.php\?t=([0-9]+))|(?:t([0-9]+)\.html)/i', $search_topics, $topics_array)) { echo "<pre>"; print_r($topics_array); } PHP: