I'm getting Property 'groups' does not exist on type 'RegExpExecArray'
when trying
const r = /\w+, (?<foo>\w+)/
const m = r.exec('hello, world')
if (m) {
const groups = m.groups
}
Javascript has an option to call .groups
on a regex exec result. And I know the output is actually an array... but grabbing a specific index to get the groups seems a bit hacky. Is pulling from the list the only option in Typescript?