in reply to Simple regrep question

Maybe just look at HTML::LinkExtor?

Depending on how your URLs are structured, maybe the following will also suffice:

m!\b(http://.*?\.mp3)\b!

But that would also capture sequences of URLs like

http://example.com/ this is some text about my .mp3 files.

Replies are listed 'Best First'.
Re^2: Simple regrep question
by Athanasius (Archbishop) on Jun 26, 2016 at 08:27 UTC

    Easily fixed by excluding whitespace:

    #! perl use strict; use warnings; for ('Look here: http://example1.com/cool.mp3 for a great listen!', 'http://example.com/ this is some text about my .mp3 files.') { print "Match: $1\n" if m!\b(http://\S*?\.mp3)\b!; }

    Output:

    18:26 >perl 1664_SoPW.pl Match: http://example1.com/cool.mp3 18:26 >

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,