Extracting backtick replacement string as a variable