On Tue, Mar 21, 2006 at 09:27:28AM -0500, Jay Savage wrote:
> On 3/20/06, stu meacham <[EMAIL PROTECTED]> wrote:
> >
> > > perl -i -p -e 's/^(\d{2}\t\d{2}\t\d{2})/g' This was the 1st thing that I
> > > tried; it doesn't work. It was initially easy but different things kept
> > > appearing that forced me to use > 1
> > statements on the command line. Negating what I want seems like it ought
> > to be simple.
>
> 2) You've anchored your patttern at the beginning of the string. This
> makes /g a no-op; you're pattern can't possibly match more than once,
> because '^' can only appear once.
I think that was in large part my fault. I sent an email with a
proposed solution while I was half-asleep, and ended up making two
errors:
1. I accidentally sent it to the individual rather than the list.
2. I screwed up the regex pretty badly.
If I'd been fully conscious and thinking clearly, what I would have sent
would have been something like this:
$foo !~ s/\d{2}\t\d{2}\t\d{2}//g
(where $foo is what you want to modify)
I just saw the initial regex example and thought "negation", then
misused the carat. Mea culpa, Jay. I didn't mean to lead you astray.
--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]
"The measure on a man's real character is what he would do
if he knew he would never be found out." - Thomas McCauley
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>