fixes #16 (only first occurrence of a match group parameter is replaced)

Please incorporate this commit. I've already send a patch 8 month ago. Hopefully, pull requests will be considered earlier.