an interesting challenge.

Joshua Zeidner jjzeidner at gmail.com
Wed Apr 5 21:19:26 MST 2006


in perl you can do something like /e(?{$i++})/{if $i>3 print $_;$i=0} no
time to code and debug though.  i guess the title of regex MASTER goes to
Jeremy for now.  jmz


On 4/5/06, Darrin Chandler <dwchandler at stilyagin.com> wrote:
>
> Darrin Chandler wrote:
>
> > Kevin Brown wrote:
> >
> >>> egrep -i '^[^e]*(e[^e]*){3}[^e]*$'
> >>>
> >>> Not only is it slightly shorter and more readable, but it's a lot
> >>> easier change it to search for of 'e' exactly n times.
> >>
> >>
> >>
> >> If I'm reading the regexp correctly you are excluding words that
> >> start with e or contain more than one e in a row.
> >
> >
> >
> > Read it some more ;)
> >
>
> Okay, maybe it's *not* more readable for most. I think it'd fly on
> phoenix.pm without much trouble.
>
> It does work and it's easier to change for different numbers of 'e'.
>
> --
> Darrin Chandler            |  Phoenix BSD Users Group
> dwchandler at stilyagin.com   |  http://bsd.phoenix.az.us/
> http://www.stilyagin.com/  |
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.plug.phoenix.az.us/pipermail/plug-discuss/attachments/20060405/af971055/attachment.htm


More information about the PLUG-discuss mailing list