             }
         }
         if try self.reversed().starts(with: reverse_pattern, by: isEquivalent) {
-            return self.index(endIndex, offsetBy: -pattern_count)
+            let strat = self.index(endIndex, offsetBy: -pattern_count)
+            return strat..<endIndex
         }
         return nil
     }


public extension RandomAccessCollection where Indices.SubSequence.Iterator.Element == Index, Indices.Index == Index, Iterator.Element : Equatable {
    
    /// Returns first position of `pattern` appear in `self`, or `nil` if not match.
    ///
    /// - complexity: Amortized O(`self.count`)
    func match<C : BidirectionalCollection>(with pattern: C) -> Index? where C.Iterator.Element == Iterator.Element {
        return self.match(with: pattern, by: ==)
    }
}


        var cursor = self.index(startIndex, offsetBy: pattern_count - 1, limitedBy: endIndex) ?? endIndex
        while cursor < endIndex {
            guard let not_match = try zip(self.indices.prefix(through: cursor).reversed(), reverse_pattern).first(where: { try !isEquivalent(self[$0], $1) }) else {
                let strat = self.index(cursor, offsetBy: 1 - pattern_count)
                let end = self.index(cursor, offsetBy: 1)
                return strat..<end
            }
            let notMatchValue = self[not_match.0]
            if let pos = try reverse_pattern.dropFirst().index(where: { try isEquivalent(notMatchValue, $0) }) {
