Thursday, January 1, 2009

Finding Words from a Set of Letters

grep "^[asdfzxcv]\{4,\}$" /usr/share/dict/words

Will search the file words, which contains a heap of English words, for words that consist of any of the enclosed letters, of a length of 4. You can manipulate the letters or length as pleased.

Use this for what, you may wonder. Well, wonder no more! If you're trying to find what words can be formed from the right-side of the keyboard, for any number of characters, well, here's your solution! Tada!

ALL HAIL THE POWER OF REGEX!

3 comments:

Anonymous said...

HAIL REGEX!

Nemo said...

dont u love it?

Nosayba El-Sayed said...

"If you're trying to find what words can be formed from the right-side of the keyboard"

Indeed, should I ever become half parallelized or should a monkey fall on the left side of my keyboard and crash it...?

Genius stuff, love it. I'm thinking poetry.. Forming words of a fixed number of characters and fixing the last 2 or 3 to go with a certain rhythm.