iftempIndices[0].startIdx ==tempIndices[0].endIdx {// If we have a zero-length match, we have to shift the index at which we start. Otherwise we keep looking at the same paert of the string over and over.
returntrue,tempIndices,tempIndices[0].endIdx +1
iftempIndices[0].StartIdx ==tempIndices[0].EndIdx {// If we have a zero-length match, we have to shift the index at which we start. Otherwise we keep looking at the same paert of the string over and over.
iftempIndices[0].startIdx ==tempIndices[0].endIdx {// If we have a zero-length match, we have to shift the index at which we start. Otherwise we keep looking at the same paert of the string over and over.
returntrue,tempIndices,tempIndices[0].endIdx +1
iftempIndices[0].StartIdx ==tempIndices[0].EndIdx {// If we have a zero-length match, we have to shift the index at which we start. Otherwise we keep looking at the same paert of the string over and over.
returntrue,tempIndices,tempIndices[0].EndIdx +1
}else{
returntrue,tempIndices,tempIndices[0].endIdx
returntrue,tempIndices,tempIndices[0].EndIdx
}
}
ifstartIdx==startingFrom{// Increment starting index if we haven't moved in the string. Prevents us from matching the same part of the string over and over.
typestateContents[]int// Represents the contents of the current state - character classes can have multiple contents, which is why it is represented as a slice