use strict;
my $str = '<tr>
<td width="70"><strong>Released:</strong></td>
<td>July 25, 2014</td>
</tr>
<tr>
<td width="70"><strong>Runtime:</strong></td>
<td>90 mins </td>
</tr>
<tr>
<td width="70"><strong>Genres:</strong></td>
<td><span class="movie_info_genres"><a href="/?genre=Action">Action</a> <a href="/?genre=Sci-Fi">Sci-Fi</a> </span></td>
</tr>
<tr>
<td width="70"><strong>Actors:</strong></td>
<td><span class="movie_info_actors">
<a href="/?actor_name= Analeigh Tipton "> Analeigh Tipton </a> <a href="/?actor_name= Morgan Freeman "> Morgan Freeman </a> <a href="/?actor_name= Scarlett Johansson "> Scarlett Johansson </a> <a href="/?actor_name=Min-sik Choi">Min-sik Choi</a> </span></td>
</tr>';
my $regex = qr/<tr>\n\s*<td width="70"><strong>Released:<\/strong><\/td>\n\s*<td>(.*)<\/td>\n\s*<\/tr>\n\s*<tr>\n\s*<td width="70"><strong>Runtime:<\/strong><\/td>\n\s*<td>(.*)<\/td>\n\s*<\/tr>\n\s*<tr>\n\s*<td width="70"><strong>Genres:<\/strong><\/td>\n\s*<td><span class="movie_info_genres"><a\s[^<>]*>([^<>]*)<\/a>/mp;
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