It functions as the object of 'regret'.
Previous Question
Which of these is a gerund?
Next Question
In "He insists on arriving early," 'arriving early' is: