$html = '
asdf
zxcv
'; preg_match_all("/(]*>).+?zxcv.+?<\/table>/s", $html, $matches, PREG_SET_ORDER); var_dump($matches); exit; // RESULTS: array 0 => array 0 => '
asdf
zxcv
' (length=93) 1 => '' (length=7) ***** how can i get just the second table?