开发者

Regex to get all links to .mp3 files

开发者 https://www.devze.com 2023-03-06 10:33 出处:网络
$regex_pattern = \"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\开发者_如何学C.&]*)\";
$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";
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号