fix #9895 - Add functional style regex pattern-matching

The function std.regex.regexSwitch matches a string on multiple regular
expressions, and runs a delegate based on which regex matched the input
string.

The function std.regex.callWithCaptures is a helper function that calls a
delegate with regex captures distributed into it's parameters. It was created
to be used in regexSwitch, but it's generic enough to have other uses so I made
it a separate function.