Matches a string against a regular expression and replaces all matches with the string generated from the substitution parameter. After each substutition is done, the portions of the string already examined, including the newly substituted region, are
not checked again for new matches -- only the rest of the string is examined.
@param str The string to match against this regular expression.
@param subspec The substitution parameter, described in
REGULAR EXPRESSION SUBSTITUTION.
@return The string formed by replacing all the matches in
str
with the strings generated from
subspec
. If no matches were found, then the return value is a copy of
str
.