I want to replace a only one instance with a regex rather than all of them. How would I do this with Go's regexp library?
input: foobar1xfoobar2x
regex: bar(.)x
replacement: baz$1
ReplaceAllString output: foobaz1foobaz2
ReplaceOneString output: foobaz1foobar2x
Regexp.ReplaceAllString. An equivalent api forReplaceOneStringdoesn't seem to exist.