$regex_pattern = "((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\开发者_如何学C.&]*)";
This code gets all HTTP links but I only need .mp3 links
Simply put \.mp3
at the end.
$regex_pattern = "((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*\.mp3)";
If you only need .mp3 links, then you should only need to check for .mp3, so
$regex_pattern = "\.mp3";
精彩评论