0

I have this regex which is working correctly for urls but when i use a url containing @ it doesnot show anything after @. How can i edit the regex to show full url

    <?php

$regex = "/(https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(\/+[a-z0-9_.\:\;-]*)*(\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?([\&\%\|\+&a-z0-9_=,\:\;\.-]*)([\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)}*/i";


$url = "http://www.flickr.com/photos/16506140@N05/8376411748/in/photostream/";

preg_match_all($regex, $url, $matches);

echo'<pre>';
print_r($matches);
echo '<pre>';

?>

DEMO http://codepad.viper-7.com/oVHcdN

4

1 に答える 1