In this question I understood that we can only refer to captured groups in the rename command using single quotes.
Is there a way to use both captured groups and other variables in the same rename command?
Example:
var="-old_file"
cd /etc
rename 's/(bash\.bashrc)/$1$var/' *