package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)[([^[]]+)]s*(([^()]+))`)
var str = `[内容] (xxxx)`
var substitution = "http://$2/$1"
fmt.Println(re.ReplaceAllString(str, substitution))
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…