Fixes #464 - Incorrect regex usage on extended grapheme clusters

This commit is contained in:
Stefan Ceriu
2023-02-09 09:50:18 +02:00
committed by Stefan Ceriu
parent 910a8e2067
commit 8932e83929
7 changed files with 64 additions and 20 deletions
@@ -89,7 +89,7 @@ class TestMeasurementParser {
}
let string = String(data: handle.availableData, encoding: .utf8) ?? "<Non-ascii data of size\(handle.availableData.count)>\n"
self.regex.matches(in: string, options: .reportCompletion, range: NSRange(location: 0, length: string.count)).forEach {
self.regex.matches(in: string, options: .reportCompletion).forEach {
if let nameIndex = Range($0.range(at: 1), in: string),
let averageIndex = Range($0.range(at: 3), in: string) {
let name = String(string[nameIndex])