Adding regular expression find option to UITextView

I'm trying to implement a regular expression search in a UITextView with the UITextView.findInteraction introduced in iOS 16. The documentation shows a UIFindInteraction.optionsMenuProvider property and reads

You use this closure to modify, augement or omit options from the default set available in UITextSearchOptions.

But it's not clear how to actually modify the UITextSearchOptions, and where these options are even stored. And how would I omit options? How can the UIActions passed as the only argument to UIFindInteraction.optionsMenuProvider be distinguished from one another?

Adding regular expression find option to UITextView
 
 
Q