I am trying to write a gsub for a regex match, but I imagine there\'s a more perfect way to do this .
My equation :
ref.gsub(ref.match(/settings(.*)/)[1
Why not do the simplest possible thing that could work?
ref.gsub(/(settings)(.*)/, '\1')