Take caution when advancing to the next match after an empty string was matched not to stuck at the same position.
This commit is contained in:
@@ -244,7 +244,7 @@ private fun Matcher.findNext(from: Int): MatchResult? {
|
||||
}
|
||||
|
||||
|
||||
override fun next(): MatchResult? = this@findNext.findNext(matchResult.end())
|
||||
override fun next(): MatchResult? = this@findNext.findNext(matchResult.end() + if (matchResult.end() == matchResult.start()) 1 else 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user