Executes a RegExp against a string, resetting its lastIndex to prevent stateful matching.
The string to match.
The pattern used to extract a value.
The first capture group if nonempty, otherwise the full match, or undefined if there is no match.
undefined
Executes a RegExp against a string, resetting its lastIndex to prevent stateful matching.