sharplet/Regex

Optional captures throw fatal error when not present

Closed this issue · 3 comments

e.g.

let fooRegex = Regex("(foo)?bar")
print(fooRegex.match("bar")?.captures) // fatal error: subscript: subRange extends past String end

Sorry, just noticed #20.

Just FYI, this is available on master now. I'd also like to push 0.3 soon!

Awesome, thanks for the quick turnaround!