{"action":"closed","issue":{"url":"https://api.github.com/repos/sharplet/Regex/issues/22","labels_url":"https://api.github.com/repos/sharplet/Regex/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/sharplet/Regex/issues/22/comments","events_url":"https://api.github.com/repos/sharplet/Regex/issues/22/events","html_url":"https://github.com/sharplet/Regex/issues/22","id":123270008,"number":22,"title":"Optional captures throw fatal error when not present","user":{"login":"danielbreves","id":2517811,"avatar_url":"https://avatars.githubusercontent.com/u/2517811?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbreves","html_url":"https://github.com/danielbreves","followers_url":"https://api.github.com/users/danielbreves/followers","following_url":"https://api.github.com/users/danielbreves/following{/other_user}","gists_url":"https://api.github.com/users/danielbreves/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbreves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbreves/subscriptions","organizations_url":"https://api.github.com/users/danielbreves/orgs","repos_url":"https://api.github.com/users/danielbreves/repos","events_url":"https://api.github.com/users/danielbreves/events{/privacy}","received_events_url":"https://api.github.com/users/danielbreves/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-21T12:25:28Z","updated_at":"2015-12-21T12:26:24Z","closed_at":"2015-12-21T12:26:24Z","body":"e.g.\r\n\r\n```swift\r\nlet fooRegex = Regex(\"(foo)?bar\")\r\nprint(fooRegex.match(\"bar\")?.captures) // fatal error: subscript: subRange extends past String end\r\n```"}}