my $s = '<B>Estimated:</B>
The N-terminal of the sequence considered is M (Met).
The estimated half-life is: 30 hours (mammalian reticulocytes, in vitro).
>20 hours (yeast, in vivo).
>10 hours (Escherichia coli, in vivo).
<B>Instability index:</B>
The instability index (II) is computed to be 31.98
This classifies the protein as stable.';
我想从字符串中删除的<B></B>
标签,并把下划线粗体标签。
我预期的输出是
Estimated:
---------
The N-terminal of the sequence considered is M (Met).
The estimated half-life is: 30 hours (mammalian reticulocytes, in vitro).
>20 hours (yeast, in vivo).
>10 hours (Escherichia coli, in vivo).
Instability index:
------------------
The instability index (II) is computed to be 31.98
This classifies the protein as stable.
对于这种尝试下面的正则表达式,但我不知道是什么问题存在。
$s=~s/<B>(.+?)<\/B>/"$1\n";"-" x length($1)/seg; # $1\n in not working
在上面的正则表达式我不知道如何把这个"$1\n"
?以及如何使用由;
或其他分隔的替代连续语句?
我该如何解决?
您正在使用哪个版本的Perl? – Zaid
@Zaid Perl版本是'5.14' – mkHun