I am getting a syntax error:
Description: Error at character 6 in regular expression "( .{0,$retain})(-)": expected digit in quantifier
when I try to use a variable in my regex in a replace(). This works fine if I use a digit in place of $retain. Am I out of luck if I want this to be variable?