diff options
author | Mark Wielaard <mark@klomp.org> | 2005-02-06 17:12:44 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2005-02-06 17:12:44 +0000 |
commit | bc06aa3889246cb2df9742430256ebaf7955ccdc (patch) | |
tree | f2d3e6d5460e9d955bc5a57fb0cabeae3f318666 /java/util/regex/Matcher.java | |
parent | 1128d0ed262460e7eab2ad95c9e9c824d6d27187 (diff) | |
download | classpath-bc06aa3889246cb2df9742430256ebaf7955ccdc.tar.gz |
Reported by Timo Lindfors <timo.lindfors@iki.fi>
java/util/regex/Matcher.java (lookingAt): Set position when match
found.
(matches): Implemented through lookingAt().
Diffstat (limited to 'java/util/regex/Matcher.java')
-rw-r--r-- | java/util/regex/Matcher.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/java/util/regex/Matcher.java b/java/util/regex/Matcher.java index 994893ad8..f8c8f1a4a 100644 --- a/java/util/regex/Matcher.java +++ b/java/util/regex/Matcher.java @@ -212,7 +212,10 @@ public final class Matcher if (match != null) { if (match.getStartIndex() == 0) - return true; + { + position = match.getEndIndex(); + return true; + } match = null; } return false; @@ -230,7 +233,13 @@ public final class Matcher */ public boolean matches () { - return find(0); + if (lookingAt()) + { + if (position == input.length()) + return true; + match = null; + } + return false; } /** |