preg_match_all( '/<tr[^>]*([sS]*?)</tr>/i', $string, $matches ); echo "<pre>"; print_r( $matches); echo '</pre>';