001 6:52 PM
> To: Girish (Skyscape)
> Cc: [EMAIL PROTECTED]
> Subject: Re: Regex query
>
>
> On Oct 25, Girish (Skyscape) said:
>
> >%Replacements = (
> > ";s(\d)", "$1"
> > ,";b(\d)", "$1"
> >);
On Oct 25, Girish (Skyscape) said:
>%Replacements = (
>";s(\d)", "$1"
> ,";b(\d)", "$1"
>);
Your problem is that these double-quoted strings get interpolated right
here. "\d" is "d", and "$1" is whatever the value of $1 is at the
time. You'll need to take a more involvi
irish (Skyscape)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 11:42 AM
Subject: Regex query
> Hi All,
>
> Can this be done ?
>
> sample string
> E=mc;s2
>
> should get converted to
> E=mc2
>
> similarly H;
Hi All,
Can this be done ?
sample string
E=mc;s2
should get converted to
E=mc2
similarly H;b2O should get converted to H2O
for this I use following code
%Replacements = (
";s(\d)", "$1"
,";b(\d)", "$1"
);
$inputstr = "E=mc;s2";
foreach $x (keys %Replacements)
{