[Rio-pm] Performance de regex

Alexei Znamensky russoz em gmail.com
Quarta Março 17 13:46:30 PDT 2010


2010/3/17 Marcos Machado <listas em istf.com.br>
[...]

> Meu primeiro chute foi:
>
> <code>
> cat OLD.log | perl -nle 'print if !/^string1|string2/;' > NEW.log
> </code>
>

Não deveria ser:

perl -nle 'print if !/^(string1|string2)/'  # com parenteses

ou mais legível:

perl -nle 'print unless /^(string1|string2)/'

??


-- 
Alexei Znamensky [russoz_gmail_com] [russoz.wordpress.com] [
www.flickr.com/photos/alexeiz]
"Though we live in trying times, we're the ones who have to try"
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20100317/bce33393/attachment.html>


Mais detalhes sobre a lista de discussão Rio-pm