package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(href=")([^"]*\.[^".]+)(")`)
var str = `<li><a href="Blah/Index.html">Blah</a></li>
<li><a href="/blah/Index.html">Blah</a></li>
<li><a href="../Blah/index.html">Blah</a></li>
<li><a href="../Foo/Index.html">Foo</a></li>`
var substitution = "$1\L$2\E$3"
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/