use strict;
my $str = 'Connecting rod fitted to prevent steering tie rod from cranking:
[url=http://s557.photobucket.com/user/realboss7669/media/F707F408-829F-48B9-9AED-BB57CEFF96C0_zpslwioah0z.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/F707F408-829F-48B9-9AED-BB57CEFF96C0_zpslwioah0z.jpg[/img:jaeyh8wg][/url:jaeyh8wg]
From the rear:
[url=http://s557.photobucket.com/user/realboss7669/media/05AE0DB2-83FD-4B2C-9FDA-E3257DFEB832_zpsc6cfuqwi.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/05AE0DB2-83FD-4B2C-9FDA-E3257DFEB832_zpsc6cfuqwi.jpg~original[/img:jaeyh8wg][/url:jaeyh8wg]
Steering damper mounts finished - without the connecting rod the damper would get bent:
[url=http://s557.photobucket.com/user/realboss7669/media/C85A0F5D-413D-4779-9F09-BD43BB798238_zpse8s6dxyu.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/C85A0F5D-413D-4779-9F09-BD43BB798238_zpse8s6dxyu.jpg[/img:jaeyh8wg][/url:jaeyh8wg]
<!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->';
my $regex = qr/\[img.*\].*photobucket.*(.jpg)\[\/img.*\]/ip;
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