I'm doing a bunch of parsing and search/replaces, I'm better at perl than
sed (which isn't saying much)

Jay
----- Original Message -----
From: "Micah Cowan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 1:01 PM
Subject: Re: [vox-tech] Simple regex question


> On Wed, May 23, 2001 at 11:18:30AM -0500, Jay Strauss wrote:
> > I have two variables:
> >
> > my $fromuser = "CRPCTL";
> > my $touser = "CT7333";
> >
> > I have a text file with a bunch of "CRPCTLI"s in it, and want to change
them
> > to "CT7333_I".  But I can't form the proper regex:
> >
> > I tried
> >
> > s/$fromuser."I"/$touser."_I/g;
> > s/"$fromuserI"/"$touser_I"/g;
> > s/$fromuser\."I"/
> >
> > I don't want to have to do:
> > $search = $fromuser."I";
> > $replace = $touser."_I";
> >
> > s/$search/$replace/g;
> >
> > Jay
> >
> > Jay Strauss
> > [EMAIL PROTECTED]
>
> Must you use perl?  Why not:
>
> sed 's/CRPCTLI/CT7333_I/g'
>
> ?
>
> Micah


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to