Skip to content

Instantly share code, notes, and snippets.

@ProTip
Created August 1, 2014 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProTip/f7845e9b2cf36b6e8731 to your computer and use it in GitHub Desktop.
Save ProTip/f7845e9b2cf36b6e8731 to your computer and use it in GitHub Desktop.
var field = "This is an error message about windows"
func main(){
fmt.Println("Hello World")
matcher := regexp.MustCompile(`(windows)|(bob)|(error)`)
matches := matcher.FindAllStringSubmatch(field,-1)
fmt.Println(matches)
#######################################
[[error _ _ error] [windows windows _ _]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment