For example, in this sentence,
Let freedom ring from the mighty mountains of New York. Let freedom ring from the heightening Alleghenies of Pennsylvania. Let freedom ring from the snow-capped Rockies of Colorado. Let freedom ring from the curvaceous slopes of California.
how to replace "Let freedom" with
"[1] Let freedom", "[2] Let freedom2", and so on.
I searched the Go regexp package, failed to find anything related increase counter. (Only find the ReplaceAllStringFunc
, but I don't know how to use it.)