an interesting challenge.

Darrin Chandler dwchandler at stilyagin.com
Wed Apr 5 20:07:55 MST 2006


Bah!

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.

Joshua Zeidner wrote:

> nice.  i would just use perl and embed some code in the regular 
> expression itself.  you are the regex MASTER.  jmz
>
>
> On 4/4/06, *Jeremy C. Reed* < reed at reedmedia.net 
> <mailto:reed at reedmedia.net>> wrote:
>
>     On Tue, 4 Apr 2006, Joshua Zeidner wrote:
>
>     > Ok wise guy...can you tell me all the english words that use the
>     letter 'e'
>     > exactly threee times?  jmz
>
>     :)
>
>     $ cat /usr/share/dict/{pr,w}* | egrep -i
>     '^[^e]*e[^e]*e[^e]*e[^e]*$' | \
>       sort -u | wc -l
>        20189
>
>     Includes some multi-word phrases, like:
>
>     Benkulen tea
>     Bermuda-lily disease
>     Dartmouth college case
>     yew green
>     zebra parakeet
>
>     And a bunch of words like Echinosphaeritidae, Juniperaceae and more.
>
>     Jeremy C. Reed
>     ---------------------------------------------------
>     PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>     <mailto: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
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------
>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
>


-- 
Darrin Chandler            |  Phoenix BSD Users Group
dwchandler at stilyagin.com   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |



More information about the PLUG-discuss mailing list