I have lines like:storedVars[css_delete_driver] = css=.driver:nth-child(2) *[data-method=delete];storedVars[css_delete_driver2_mobile] = css=a.remove-driver;and I want to create a file with methods such as:def css_delete_vehicle_everquote  css=.autos .auto *[data-method=delete]enddef css_delete_driver  css=.driver:nth-child(2) *[data-method=delete]endhow could I do that with sed ?
How could I use sed to convert a js file with storedVars to a ruby file with methods?
sed
A version that will work with s/ per line and no in-line returns might be:cat Variables/user-extensions.js | sed $'s/storedVars/def /s/\[//s/\]//s/= /\\\n  /s/;/\\\nend/'because $'string' changes \\\n to newlines as detailed in  https://stackoverflow.com/a/18410122/631619