summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-12-18 05:02:47 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-12-18 05:02:47 -0500
commitc06e22eea1c54aa90d93f705b58ed5887d9fffd6 (patch)
treebdf1a63dade7f6dc31abf1c9579fe9b97ee30b79
parentaba72b1e077645882b4bbcafab8fb5c969e2613a (diff)
downloadgames-word-c06e22eea1c54aa90d93f705b58ed5887d9fffd6.tar.gz
games-word-c06e22eea1c54aa90d93f705b58ed5887d9fffd6.zip
anchor this regex, so it stops just matching everything
-rw-r--r--lib/Games/Word.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm
index f721afb..f875c67 100644
--- a/lib/Games/Word.pm
+++ b/lib/Games/Word.pm
@@ -198,7 +198,7 @@ sub is_substring {
return 1 if $substring eq '';
return 0 if $string eq '';
my $re = join('?', map { quotemeta } split(//, $string)) . '?';
- return $substring =~ $re;
+ return $substring =~ /^$re$/;
}
=item all_substrings STRING