As another alternative, consider something like this:

```go
// colorize returns s with ANSI color codes inserted
// according to the process type.
func colorize(s string) string {
  if i := strings.Index(s, ":"); i != -1 {
    head, rest := s[:i], s[i:]
    pre, post := resolve(procType(head))
    return pre + head + post + rest
  }
  return s
}

// procType extracts the process type from a heroku log line header.
// For input of the form
//   2013-10-07T09:53:43.036261+00:00 app[foo.1248]
// it returns "foo".
func procType(s string) string {
  p := strings.Index("[")
  s = s[p+1:]
  for i, c := range s {
    if !(unicode.IsLetter(c) || unicode.IsDigit(c) || c == '-') {
      return s[:i]
    }
  }
  return ""
}
```

I think this is more readable than the regular expression.
(Though I didn't try very hard to match behavior exactly;
this is just something that is hopefully good enough.)
But if you feel strongly that the regexp is better, I'm ok
with that as well. :)