mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
12 lines
231 B
Go
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])
|
|
}
|