Reported by Timo Lindfors <timo.lindfors@iki.fi> java/util/regex/Matcher.java...
2005-02-07 Mark Wielaard <mark@klomp.org> Reported by Timo Lindfors <timo.lindfors@iki.fi> java/util/regex/Matcher.java (lookingAt): Set position when match found. (matches): Implemented through lookingAt(). 2005-02-07 Mark Wielaard <mark@klomp.org> Fix suggested by Timo Lindfors <timo.lindfors@iki.fi> * java/util/regex/Pattern.java (split(CharSequence,int)): Fix while empties > 0 loops. From-SVN: r94713
This commit is contained in:
parent
7f5c93ac95
commit
0384c7652f
3 changed files with 34 additions and 6 deletions
libjava/java/util/regex
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue