Re: regexpr

2003-07-11 Thread Martin Costello
Thanks again - that "/eg" opens up a whole world of possibilities! John W. Krahn wrote: q() is another way of saying ''. All the quote operators can be found in the perlop.pod document under "Quote and Quote-like Operators" section. If you want your version to work correctly you are going to hav

Re: regexpr

2003-07-11 Thread John W. Krahn
Martin Costello wrote: > > John W. Krahn wrote: > > > >Here is one way to do it: > > > >$ perl -e' > >$text = q/ > > > >blahblah -blah blah > >-blah blah -blah $blah -blah "Ground" > >-c "blah transformC" transformC; > > > >blahblah > >-af transformC"blah"($blah) > >-af Atr

Re: regexpr

2003-07-11 Thread Martin Costello
John, Thank you ever so much - that seemed to work. In my code I'm actually using variables for the names to replace: so my substitute looks like this : $line =~ s/("[^"]+"|\w+)/ $1 eq $oldList[$i] ? $newList[$i] : $1 eq "$oldList[$i]" ? "$newList[$i]" : $1 /eg; (I removed the q( ) parts from y

Re: regexpr

2003-07-11 Thread John W. Krahn
Martin Costello wrote: > > Hello, Hello, > I'm trying to do a search and replace on a file (specifically the word > transformC). A cut down version of the file is below: > > blahblah -blah blah > -blah blah -blah $blah -blah "Ground" > -c "blah transformC" transformC; > > blahblah >

regexpr

2003-07-11 Thread Martin Costello
Hello, I'm trying to do a search and replace on a file (specifically the word transformC). A cut down version of the file is below: blahblah -blah blah -blah blah -blah $blah -blah "Ground" -c "blah transformC" transformC;

Re: Regexpr

2002-12-16 Thread Jeff 'japhy' Pinyan
On Dec 16, Paul Kraus said: >How can I grab a numeric string that contains commas. ... that ALSO contains periods in it. >POINTPoint Health Centers 19,466.79 >0.00 401.20 0.00 19,867.99 >if (/(^POINT)\s+ Point Health Centers\s+([\d\,]*)

Regexpr

2002-12-16 Thread Paul Kraus
How can I grab a numeric string that contains commas. String -- POINTPoint Health Centers 19,466.79 0.00 401.20 0.00 19,867.99 My Expr --- if (/(^POINT)\s+ Point Health Centers\s+([\d\,]*)\s+.*/){ print "$1 $2\n"; } What it