package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<=<http:\/\/example\.com#Example\/[^>]*)\/(?=[^>]*>)`)
var str = `@Don't replace this line: <http://nomatch.com#>
/or this line!/
<http://example.com#Example/Replace/With/Underscores>
<http://example.com#Example/Can/Have/Trailing/Slash/>
</Nothing to replace on this line either./>`
var substitution = "_"
fmt.Println(re.ReplaceAllString(str, substitution))
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/