1. :g/pattern/s/old/new
The first g tells the command to operate on all lines of a file. pattern identifies the lines
on which a substitution is to take place. On those lines containing pattern, ex is to
substitute (s) for old the characters
old could be regular expression
2. :%s/old/new/g
% indentifies all lines
s substitudes command
"old" could be regular expression