This is how I ended up working around this problem. I used two separate regexes to match the first and second capture groups and run two gregexpr calls, then pull out the matched substrings:
str_match(), from the stringr package, will do this. It returns a character matrix with one column for each group in the match (and one for the whole match):