If the pattern you have provided works for a string, then all you should need to do is to read the entire file into a string and pass that to the regex.
It looks like you are searching for email addresses (something a regex is typically NOT good at doing by the way - my work email would fail to match your pattern for example because it has multiple periods in it) as assuming that they cannot be split over multiple lines, then you should not need any special options (e.g. singleline or multiline).
Therefore, an alternative would be to write your own function to read a line from the file, pass it to your regex and check for a successful match.
If this is failing in some way, can you tell us the error message(s)?
On the other hand if this is a question about what arguments you need to pass to the function, then I don't know if this is necessarily the right forum to ask. (Looking at the template definitions that you references, this is the reason why I consider C++ and templates to be a bad joke that got way out of hand!!!!!!)
Susan