From: Yukihiro Matsumoto <matz / netlab.co.jp> ... > In message "[ruby-talk:02003] Re: Ruby Syntax similar to other languages?" > on 00/03/18, "Conrad Schneiker" <schneiker / jump.net> writes: > > |> What's the benefit of foo.s(/pat/, "repl", "g") over foo.gsub(/pat/, > |"repl")? > | > |In vi, sed, and perl, you don't thing of sub and gsub as being two different > |methods, but rather as a single method that is modulated by optional > |parameters--including g, i, s, m, o, e, and x in perl (IIRC), which I > |wouldn't want to see replaced by individual methods, since I (currently) > |think it is much more natural to regard all of these things as variations on > |a common theme. > > Hmm, although I think options i, s, m, o, and x should belong to > regexp, I can understand your opinion. Could g belong to regexp as well? If so, then foo.sub(/pat/g, "repl") would be fine with me. Conrad