Backport: Bring back Gitlab::UntrustedRegexp.with_fallback

What does this MR do?

Backport for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10563

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/10864

Does this MR meet the acceptance criteria?

Merge request reports

Loading