Given a regex and a string s, I would like to generate a new string in which any substring of s matched by the regex is surrounded by parentheses.
For example: My original string s is "Alan Turing 1912-1954" and my regex happens to match "1912-1954". The newly generated string should be "Alan Turing (1912-1954)".