diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-12-18 05:02:47 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-12-18 05:02:47 -0500 |
commit | c06e22eea1c54aa90d93f705b58ed5887d9fffd6 (patch) | |
tree | bdf1a63dade7f6dc31abf1c9579fe9b97ee30b79 /lib/Games/Word.pm | |
parent | aba72b1e077645882b4bbcafab8fb5c969e2613a (diff) | |
download | games-word-c06e22eea1c54aa90d93f705b58ed5887d9fffd6.tar.gz games-word-c06e22eea1c54aa90d93f705b58ed5887d9fffd6.zip |
anchor this regex, so it stops just matching everything
Diffstat (limited to 'lib/Games/Word.pm')
-rw-r--r-- | lib/Games/Word.pm | 2 |
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 |