[Solved] Generate string containing escaped interpolation
You have not the ‘\’ in the string, it is added by the inspect: if you puts the string you will realize it: asd = ‘<%= asd %>’.gsub(/<%=(.*)%-?>/, “\#{\\1}”) #=> “\#{ asd }” p asd #=> “\#{ asd }” <- this is `asd.inspect`, which is returned by `p` “\#{ asd }” <- this is `asd.inspect`, … Read more