Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Show matching words in Dictionary with a wildcard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Show matching words in Dictionary with a wildcard
Authored by: Nem on Jul 11, '07 10:32:00AM

Of course, for the command line junkies, there's a more more powerful and flexible way to do this:

egrep "^.oat$" /usr/share/dict/words

Leave the carat (beginning of line) and dollar sign (end of line) and replace the chars inbetween. For crossword puzzles, just replace a missing letter with a period (as many as you like).

By using a question mark, you can even find words that may or may not have a characters (like an 's' in 'hints' - 'hints' won't appear, but 'hint' will):

egrep "^hint.?$" /usr/share/dict/words

I'm sure somebody could whip up a quick Applescript for this.

---
Nem W. Schlecht
http://geekmuse.net/



[ Reply to This | # ]
make this command easier to use with an alias
Authored by: hayne on Jul 11, '07 08:44:03PM
I use the following Bash alias (set up via my ~/.profile):


findword () { /usr/bin/grep ^"$@"$ /usr/share/dict/words ; }

Sample usage:


% findword '.oat'
boat
coat
doat
goat
moat
toat

% findword 'oat...'
oatbin
oatear
oathay
oathed


[ Reply to This | # ]
Show matching words in Dictionary with a wildcard
Authored by: jksellors on Jul 11, '07 10:34:33PM
Here is a short Applescript:
set theWords to text returned of (display dialog "Please enter grep request." default answer "^.oat$" with icon 1)
display dialog (do shell script "egrep " & theWords & " /usr/share/dict/words")


[ Reply to This | # ]
Show matching words in Dictionary with a wildcard
Authored by: bkemper on Jul 12, '07 08:58:45PM

Pretty good tip. It seems to require single quotes instead of double though. Like this:

egrep '^.oat$' /usr/share/dict/words

or for all words ending in "oat" (including the word "oat"):

egrep '^.*oat$' /usr/share/dict/words



[ Reply to This | # ]