Fixed bug in regex replace, need to use a variable, not a function