Regex Using a Variable as Replacement Including Capture Group

Sure. Because no further processing happens after the token expansion that expands the replacement variable. So just like if the replacement text was %LongDate%, your result would be %LongDate% not the date, the $1 has no meaning within the variable.

3 Likes