fork download
  1. package main
  2. import ( "fmt"
  3. "regexp"
  4. )
  5.  
  6. func main(){
  7. // your code goes here
  8. test := `(?i)\b(co.)(?:\s|$)`
  9. re := regexp.MustCompile(test)
  10. matches := re.FindAllStringSubmatch("co. is a secret shortcut ", -1)
  11. for _, match := range matches {
  12. fmt.Printf("'%s'", match[1])
  13. }
  14. }
Success #stdin #stdout 0.01s 7792KB
stdin
Standard input is empty
stdout
'co.'