use strict;
my $str = '<div class="wp-playlist wp-audio-playlist wp-playlist-light">
<div class="wp-playlist-current-item"></div>
<p> <audio controls="controls" preload="none" width="
1118 "
>
</audio></p>
<div class="wp-playlist-next"></div>
<div class="wp-playlist-prev">
</div>
<p> <noscript></p>
<ol>
<li>
<a href=\'https://www.caferilik.com/wp-content/uploads/2020/11/Anne-Baba-Biz-Suçluyuz-Muhafazakar-Ailelerde-Kuşak-Çatışması-Sesli-Kitap-www.caferilik.com_.mp3\'>
Anne Baba Biz Suçluyuz - Muhafazakar Ailelerde Kuşak Çatışması (Sesli Kitap) www.caferilik.com<
/a></li>
</ol>
<p> </noscript><br />
<script type="application/json" class="wp-playlist-script">
{"type":"audio","tracklist":true,"tracknumbers":true,"images":true,"artists":true,
"tracks":[{"src":"https:\\/\\/www.caferilik.com\\/wp-content\\/uploads\\/2020\\/11\\/Anne-Baba-Biz-Su\\u00e7luyuz-Muhafazakar-Ailelerde-Ku\\u015fak-\\u00c7at\\u0131\\u015fmas\\u0131-Sesli-Kitap-www.caferilik.com_.mp3",
"type":"audio\\/mpeg","title":"Anne Baba Biz Su\\u00e7luyuz - Muhafazakar Ailelerde Ku\\u015fak \\u00c7at\\u0131\\u015fmas\\u0131 (Sesli Kitap) www.caferilik.com","caption":"",
"description":"\\"Anne Baba Biz Su\\u00e7luyuz - Muhafazakar Ailelerde Ku\\u015fak \\u00c7at\\u0131\\u015fmas\\u0131 (Sesli Kitap) www.caferilik.com\\".","meta":{"length_formatted":"2:28:02"},
"image":{"src":"https:\\/\\/www.caferilik.com\\/wp-includes\\/images\\/media\\/audio.png","width":48,"height":64},"thumb":
{"src":"https:\\/\\/www.caferilik.com\\/wp-includes\\/images\\/media\\/audio.png","width":48,"height":64}}]}</script>
</div>
';
my $regex = qr/(?:https?:(?:\\?\/\\?\/|www\.)|www\.)[^\s<>"']*\.mp3/mup;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html