Each side represents a set of characters, and each character on the lhs is replaced with the corresponding character from the rhs. Thus, in the previous example, nothing happens to punctuation, numbers or characters which are already in lowercase. If the number of characters in the lhs is greater than the number of characters in the rhs, the last element of the rhs will use for all unmatched characters from lhs. If the number of characters in the rhs is greater than the number of characters in the lhs, all unmatched characters from rhs will be ignored. A rainy day.
Substitutions only occur if the string on the left can be matched.
One can say that you can do that easily using the string functions index and substr . This is true, but with those functions you can not do pattern-matching. You can declare the lhs to be a patter, and then replace any occurance with the rhs. It will match any single character, except a newline. Note that the length of the string on the lhs and rhs don't need to be the same, since the whole left is replaced with the whole right.