Yeah - I know. I'm only on my second cup of coffee.
It's bugging me too - off to the Owl book for me. :-)
Andy
----- Original Message -----
From: "Lee Goddard" <[EMAIL PROTECTED]>
To: "Andy Jennings" <[EMAIL PROTECTED]>; "Allan Juul" <[EMAIL PROTECTED]>;
"ActivePerl" <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 7:30 AM
Subject: RE: simple global substitution
>
> AFAIK, [^aaa] means 'class of characters not including aaa',
> so it might as well be [^a]+, but isn't Allan using aaa just
> as an toy example? Might it not be lkjsadfl3932? in which
> case a class wouldn't apply, as it'd be unordered.
>
> This bugs me!
>
> C'mon, $Bill.... ;)
> lee
>
> > Allan
> >
> > How about:-
> >
> > $text =~ s/.*?(aaa)[^aaa]+/$1\n/ig;
> >
> > The only messy thing about this, is that it produces one blank line at
the
> > end of the output - not perfect but probably tolerable, as you can
always
> > chomp it afterward.
> >
> > hth
> >
> > Andy
> >
> > ----- Original Message -----
> > From: "Allan Juul" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, June 13, 2001 6:03 AM
> > Subject: simple global substitution
> >
> >
> > > hi
> > > am i going totally blind or?
> > > from the snip below i want to output just:
> > > aaa
> > > aaa
> > >
> > > what i get is :
> > > aaa
> > > aaa
> > > 333 444<END>
> > >
> > >
> > > why is that?
> > > thanks
> > > allan
> > >
> > >
> > > #!perl
> > > $str = "aaa 111 222 aaa 333 444<END>";
> > > output($str);
> > > sub output{
> > > $text = $_[0];
> > > $text =~ s/.*?(aaa).*?/$1\n/ig;
> > > print $text;
> > > }
> > > _______________________________________________
> > > ActivePerl mailing list
> > > [EMAIL PROTECTED]
> > > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> > >
> > >
> >
> > _______________________________________________
> > ActivePerl mailing list
> > [EMAIL PROTECTED]
> > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
>
>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl