use strict;
my $str = ' <link>http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/59fa119a24a694d3151e9f79/1509632943781/medellin-flower-festival-colombia-conde-nast-traveller-1april14-rex_-1.jpg</link>
<title>attachment-59fa119a24a694d3151e9f79</title>
<img src="http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/5a007536e4966b51e8d63db6/1509979480047/buenos-aires-unsettled-argentina-retreat-digital-nomad.jpgbuenos-aires-unsettled-argentina-retreat-digital-nomad?format=original" alt=""/>
<img src="http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/5a007536e4966b51e8d63db6/1509979480047/buenos-aires-unsettled-argentina-retreat-digital-nomad.jpgbuenos-aires-unsettled-argentina-retreat-digital-nomad?format=original" alt=""/>
"http://static1.squarespace.com/static/56eadbb9e707eb1e1ec78cca/5743a5702b8dde05e892a971/59fa1b0b71c10b694346e433/1509563194043/22860715_372374486541985_6060851298842968064_n.jpg",';
my $regex = qr/(\/(static)\/)(.*)([0-9]{13}\/)/p;
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