Hi All,
Can this be done ?
sample string
E=mc;s2
should get converted to
E=mc<sup>2</sup>
similarly H;b2O should get converted to H<sub>2</sub>O
for this I use following code
%Replacements = (
";s(\d)", "<sup>$1</sup>"
,";b(\d)", "<sub>$1</sub>"
);
$inputstr = "E=mc;s2";
foreach $x (keys %Replacements)
{
$inputstr =~ s/$x/$Replacements{$x}/g;
}
print "\n$inputstr";
I get output as E=mc;s2
Where am I going wrong ?
Thanks in advance,
Girish
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]