From: Patrick Bennett Date: 2002-08-14T08:46:13+09:00 Subject: Re: HT make gsub not case sensitive... add an 'i' after the expression. ie: some_big_string = 'SOME_substring_1 foo bar' some_big_string.gsub!(/soMe_sUbString_1/i, 'xxx') puts some_big_string -> xxx foo bar Kurt Euler wrote: >Ruby experts: > >Please advise how I can make a gsub operation NOT case sensitive, so that for example this command: > > some_big_string.gsub!(/soMe_sUbString_1/, some_substring_2) > >would do a replacement of all occurances of "soMe_sUbString_1" regardless of the case of the target string in some_big_string. Eg, the text "SOME_SUBSTRING_1" in some_big_string WOULD be replaced by "some_substring_2" using the command (or technique) I'm looking for. > >Thanks. > >-Kurt Euler > >