On Monday 12 Jul 2010 17:18:12 Steve Bertrand wrote:
> On 2010.07.09 21:57, Uri Guttman wrote:
> >>>>>> "SB" == Steve Bertrand <st...@ipv6canada.com> writes:
> >   SB> On 2010.07.09 21:40, Uri Guttman wrote:
> >   >> what input? i see none there. but what you want is either -p or -n.
> >   >> both are among the most useful options for perl oneliners. look
> >   >> them up in perlrun and pick which one you want.
> >   
> >   SB>   | perl -p -e 's/.*\s+//'
> > 
> > you need to test that one liner all by itself by feeding it some of
> > those lines. the regex is very wrong as it will delete the entire line
> > and therefore print nothing. .* matches the whole line before the
> > newline and \s+ matches the trailing newline. if you added the -l option
> > too, it would strip the newline off before regex is run and likely will
> > do what you want. but a better regex is needed. i gotta run so i can't
> > help with that now.
> 
> Thanks for the help all, here's what I've come up with:
> 
> perl -pe 's/(.*?)\s+//'

Since you're not capturing the first match it should be "(?:.*?)\s+". But here 
the clustering is redundant so you can just say "s/.*?\s+//".

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

God considered inflicting XSLT as the tenth plague of Egypt, but then
decided against it because he thought it would be too evil.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to