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