summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Games/Word/Wordlist.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Games/Word/Wordlist.pm b/lib/Games/Word/Wordlist.pm
index f7f9716..0ae24a9 100644
--- a/lib/Games/Word/Wordlist.pm
+++ b/lib/Games/Word/Wordlist.pm
@@ -114,6 +114,14 @@ sub anagrams {
return uniq grep { $self->is_word($_) } all_permutations($word);
}
+sub words_like {
+ my $self = shift;
+ my $re = shift;
+ my @words = ();
+ $self->_each_word(sub { push @words, $_[0] if $_[0] =~ $re });
+ return @words;
+}
+
=head1 NAME
Games::Word::Wordlist - ???