'; if(preg_match('/http:\/\/[^"]+/', $s, $res)) { echo $res[0]; } else { echo 'No match'; } if(preg_match('/(value=")([^"]+)(")/', $s, $res)) { echo $res[2]; } else { echo 'No match'; } ?>