Beginner gsub and ri questions

How can I do a case-insensitive global substitution? Suppose, for
example, a string contained occurences of DOG, Dog, dog, and mistyped
dOg. I want every instance to be replaced by cat (without having to
test for each case permutation).

How can I generate a large text file containing all ri documentation
available on my system? I would like the topics to be in as logical an
order as possible, and in alphabetical order otherwise. I would like to
place a \r\n\f\r\n sepearater sequence between each topic.

Jamal

“DOG” =~ /dog/i