A simple example:

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

    After execution, the output result is:

    1. John says "GoFrame" is the one he loves!