用于检测和替换锚标记的文本链接的php正则表达式

I got this regex off of a site forum to look for links in text and replace them with html links so that they are clickable.

the problem came when someone input one of those new youtube links that look like this:

http://youtu.be/djKd189-ag2

What happens is the link is made up to the dash and then -ag2 is left on it's own.

I don't know enough about php regex to even dare alter this to add parsing the dash so I was hoping I could get some help:

$newText = preg_replace('@((http|https)://([\w-.]+)+(:\d+)?(/([\w/_.]*(\?\S+)?)?)?)@', 
             '<a href="$1" class="link1" target="_blank">$1</a>',$text);

I am guessing it's somewhere around the \S+ part

$newText = preg_replace('@((http|https)://([\w-.]+)+(:\d+)?(/([\w/_-.]*(\?\S+)?)?)?)@', 
             '<a href="$1" class="link1" target="_blank">$1</a>',$text);

You need just a '-' where it's written '[\w/_.]'