Jeff and Mark, thanks,

I didn't know you could use {} in Perl, like in ksh (I should have guessed).

Thanks
Jay

----- Original Message -----
From: "Mark K. Kim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 12:04 PM
Subject: Re: [vox-tech] Simple regex question


> On Wed, 23 May 2001, Jay Strauss wrote:
>
> > Sorry, left off critical info, I'm using Perl
>
> Figured that much from "my" :)
>
> > > 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:
>
> Since underscore is a valid part of an identifier, you couldn't make
> it part of the search string.  Generally {} is used to separate the
> identifier (at least in other scripting languages).  So can't you do:
>
>    s/${fromuser}I/${touser}_I/g;
>
> ???
>
> -Mark
>
> --
> Mark K. Kim
> http://www.cbreak.org/mark/
> PGP key available upon request.


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

Reply via email to