Posted By

zingo on 07/01/08


Tagged

regex cli perl statistic


Versions (?)

Words with many doubled letters


 / Published in: Bash
 

URL: http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/

  1. # words with three consecutive doubled letters
  2. perl -ne 'print if /(.)\1(.)\2(.)\3/' /usr/share/dict/words
  3.  
  4. # words with three doubled letters, regardless of whether they’re consecutive.
  5. perl -ne 'print if /(.)\1.(.)\2.(.)\3/' /usr/share/dict/words
  6.  
  7. # words with four doubled letters
  8. perl -ne 'print if /(.)\1.*(.)\2.*(.)\3.*(.)\4/' /usr/share/dict/words

Report this snippet  

You need to login to post a comment.