To do this, we specify a replacement where we can use matched subexpressions with the character $
(see Table 14.1). Here, we use $1 and $2 to use the tag and the value found in the replacement:
"" // replacement using default syntax
Again, we can avoid having to escape the quotes by using a raw string:
R"()" // replacement using default syntax
By passing a regex constant regex_constants::format_sed, you can instead use the replacement syntax of the UNIX command sed (see the second column in Table 14.1):
"" // replacement using sed syntax
Again, by using a raw string, we can avoid escaping backslashes