Stricter check for adding zero-length match at end of string
This commit is contained in:
@@ -32,7 +32,7 @@ func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset
|
||||
// 'Base case' - exit if string is empty.
|
||||
if len(str) == 0 {
|
||||
// If the start is a Kleene star, then it should also match an empty string.
|
||||
if start.isKleene {
|
||||
if start.isKleene && start.isLast {
|
||||
indices = append(indices, matchIndex{offset, offset})
|
||||
}
|
||||
return indices
|
||||
|
Reference in New Issue
Block a user