From: Mark Thomas Date: 2008-02-26T01:04:57+09:00 Subject: Re: "OneLiner" - replacement First, I don't think the * is doing what you think it is. 'ruby - pi.bak' is probably what you want. Second, it's more efficient to use one regex when you don't really need two. ruby -pi.bak -e 'gsub(/VAR_(TYP|FREQ)/,'\1')' file.dat