lundi 23 mars 2015

Using regular expressions to search a word list. Finding 2 letter words instead of 3. Why?


I am studying regular expressions and I am stumped. Here is my process so far....


I downloaded this file.



wget http://ift.tt/1tvTvBp
mv corncob_lowercase.txt words.txt


I wanted all 3 letter words...



grep '^...$' words.txt


This DOES finds "abe"



grep '^abe.$' words.txt


This does NOT find "abe"



grep '^abe$' words.txt


This DOES find "abe" in the library that came with Arch Linux.



grep '^abe$' /usr/share/dict/cracklib-small


I am stumped on this one.



Aucun commentaire:

Enregistrer un commentaire