in reply to Re: Simple regrep question
in thread Simple regrep question
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, |
|
|---|