fork(9) download
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "regexp"
  6. )
  7.  
  8. func main() {
  9. var re = regexp.MustCompile(`(?m)-(.*?):`)
  10. var str = `ABC - What I need::Other Information I do not need`
  11. rs:=re.FindStringSubmatch(str)
  12. fmt.Println(rs[1])
  13.  
  14. }
Success #stdin #stdout 0s 4484KB
stdin
Standard input is empty
stdout
 What I need