I have a string "foo\nbar=blah", which I'd like to entirely replace
with "baz=blah".  Supposedly, the regular expression constructed with
/.../i will match newlines, but it doesn't seem to work:

> str = "foo\nbar=blah"
=> "foo\nbar=blah"
> str.sub(/.*bar/i, 'baz')
=> "foo\nbaz=blah"
> str.sub(/\A.*bar/i, 'baz')
=> "foo\nbar=blah"

Is there any way to do this?  Does the /.../i really do what I think
it should do?