次の内容を持つ 1 つの入力ファイルを解析しています。
<tr>
<th width="50%">ABC</th><th width="50%">XYZ</th>
</tr>
<tr>
<tr>
<td>avc</td>
<td>fds</td>
</tr>
コード:
#!/usr/bin/perl
open(fh,$ARGV[0]) or die "could not open a file\n";
$input=<fh>
#print($input)
if($input =~ /<tr>(\n)?(.*)(\n)?tr>/)
{
print($1);
}
しかし、出力はありません。番目のタグを持つ中間行を取得するには?