Дано:
method = "i => Label1.text = i.ToString()"
var = method[/[^ ]*/]
new1 = eval("method.gsub!(/#{var}\\\./, 'auto_var.')")
i => Label1.text = auto_var.ToString()
i => Label1.text = i[0].ToString()
let v = m.match(/[^ ]/)[0];
let r = eval(`m.replace(/${v}\\\./, 'auto_var.')`);
return eval(`r.replace(/${v}\\\[/, 'auto_var[')`);