g
Apply the replacement to all matches to the regexp, not just the first.
number
Only replace the numberth match of the regexp.
Note: the posix standard does not specify what should happen when you mix the g and number modifiers, and currently there is no widely agreed upon meaning across sed implementations. For GNU sed, the interaction is defined to be: ignore matches before the numberth, and then match and replace all matches from the numberth on.