in reply to Re: Removing all none 8 letter words from the dict/words file
in thread Removing all non 8 letter words from the dict/words file
My initial reaction was that this was going to be less efficient than the length check, but my second reaction is that this ensures that all 8 characters are perl word characters and not hyphens, periods, apostrophes, etc. -- many of which are in the typical dictionary file.
Checking length == 8 && ! /\A\w{8}\z/ found 2400 entries on my /usr/share/dict/words file.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|