fix(angular.copy): clone regexp flags correctly

Closes #5781
Closes #8337