We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74c2868 commit 34ea75aCopy full SHA for 34ea75a
Sources/FileCheck/Pattern.swift
@@ -355,7 +355,8 @@ final class Pattern {
355
guard let r = try? NSRegularExpression(pattern: regExToMatch, options: [.anchorsMatchLines]) else {
356
return nil
357
}
358
- let matchInfo = r.matches(in: buffer, range: NSRange(location: 0, length: buffer.utf8.count))
+ let distance = buffer.distance(from: buffer.startIndex, to: buffer.endIndex)
359
+ let matchInfo = r.matches(in: buffer, range: NSRange(location: 0, length: distance))
360
361
// Successful regex match.
362
guard let fullMatch = matchInfo.first else {
0 commit comments