mirror of
https://gitee.com/johng/gf
synced 2026-07-06 13:42:46 +08:00
16 lines
273 B
Go
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)
|
|
}
|