Files
gf/example/util/gregex/gregex.go
2019-07-29 21:01:19 +08:00

13 lines
230 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/text/gregex"
)
func main() {
match, _ := gregex.MatchString(`(\w+).+\-\-\s*(.+)`, `GF is best! -- John`)
fmt.Printf(`%s says "%s" is the one he loves!`, match[2], match[1])
}