Files
gf/geg/other/test.go
2018-08-06 22:38:55 +08:00

16 lines
273 B
Go

package main
import (
"fmt"
"gitee.com/johng/gf/g/util/gregex"
)
func main() {
name := "page"
path := "/page/template/{page}.html"
rule := fmt.Sprintf(`{%s}`, name, name)
tpl, err := gregex.ReplaceString(rule, `{.page}`, path)
fmt.Println(err)
fmt.Println(tpl)
}