in reply to Re: Dictionary filter regex
in thread Dictionary filter regex
Thanks to all that replied - Corion, great answer ~ I guess I am tired after a long week at work
#!/usr/bin/perl -w my @words; my $line; open (DICT, "< final.txt"); @words= <DICT>; close (DICT); foreach $line(@words) { if ($line =~ /s.*h/i) { if ( ($line =~ /s.*s/i) || ($line =~ /h.*h/i) ) { next; } print $line; } } exit;
Produces some great words ha ha!
asthmatic asthmatical asthmatically asthmatoid asthmogenic asthore asthorin astrachan astrakhan astraphobia astraphobic astrapophobia astrochronological ... crystallographically crystallography crystallophyllian crystograph ctesiphon cubbish cubbishly cuemanship cuish cultish cultishly culture shock cumshaw cunctatorship cuneoscaphoid cuproscheelite curateship curatorship curiosity killed the cat
Thanks! Nick
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dictionary filter regex
by Laurent_R (Canon) on Nov 26, 2016 at 18:46 UTC | |
by Linicks (Scribe) on Nov 26, 2016 at 21:01 UTC | |
by Laurent_R (Canon) on Nov 27, 2016 at 13:19 UTC |