preg_match_all('((https?|ftp|gopher|telnet|file|notes|ms-help):'. '((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)', $htmlText, $matches, PREG_PATTERN_ORDER); cp($matches[0]);