Question: mailto:abcd@gmail.com 
wont match the email regex.
/\A[\w+-.]+@[a-z\d-]+(.[a-z\d-]+)\*.[a-z]+\z/i 
I want to check if any substring in the given string matches the regex.
In this case, abcd@gmail.com matches the regex.

Answer: 
Please try to use `UIDocumentPickerViewController` for your use case

```
let controller = UIDocumentPickerViewController(
    documentTypes: ["public.text"], // choose your desired documents the user is allowed to select
    in: .import // choose your desired UIDocumentPickerMode
)
controller.delegate = self
if #available(iOS 11.0, *) {
    controller.allowsMultipleSelection = false
}
// e.g. present UIDocumentPickerViewController via your current UIViewController
present(
    controller,
    animated: true,
    completion: nil
)

```

`UIDocumentPickerDelegate` delegate methods to receive chosen documents URL as callback:

```
@available(iOS 11.0, *)
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
    // do something with the selected documents
}

func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
    // do something with the selected document
}

```
There is the option to open the Files app at a specific location using the `shareddocuments://` URL scheme, as described in [this article](https://www.macstories.net/ios/fs-bookmarks-a-shortcut-to-reopen-files-and-folders-directly-in-the-files-app/).

If you want the user to select a document, you can use [chriswillow's](https://stackoverflow.com/a/48851508/12234951) approach with the [UIDocumentPickerViewController](https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller).
If you want to present the documents or folders in your app, create a [Document Browser App](https://developer.apple.com/documentation/uikit/view_controllers/adding_a_document_browser_to_your_app/presenting_selected_documents).