fork download
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "regexp"
  6. )
  7.  
  8.  
  9. func main(){
  10. var mystr = "2016/07/27 21:37:50 [DEV][INFO] Executing Process 'Some process'"
  11. var pattern = regexp.MustCompile(`\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} \[.*\]\[.*\] Executing Process '.*'`)
  12. fmt.Printf("%q\n", pattern.FindAllStringSubmatch(mystr, -1))
  13. }
Success #stdin #stdout 0s 790016KB
stdin
Standard input is empty
stdout
[["2016/07/27 21:37:50 [DEV][INFO] Executing Process 'Some process'"]]