Closed
Description
From https://forums.swift.org/t/regexbuilder-repeat-range-off-by-one/58079:
import RegexBuilder
let s = "aaaaaaaaaa"
let rx = Regex {
Repeat(0...1) { "a" }
}
s.firstMatch(of: rx) // ["aa"]
Looks like we're converting 0...1
to 0..<2
and then initializing a quantification .upToN
without adjusting the upper bound down.
Metadata
Metadata
Assignees
Labels
No labels