gf/geg/util/gregex/gregex.go
2019-04-03 00:03:46 +08:00

12 lines
231 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/g/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])
}