code: func extractNick(search, extract, username, text string) (string, string, error) {
  	re, err := regexp.Compile(search)
  	if err != nil {
  		return username, text, err
  	}
  	if re.MatchString(username) {
  		re, err = regexp.Compile(extract)
  		if err != nil {
  			return username, text, err
  		}
  		res := re.FindAllStringSubmatch(text, 1)
  		// only replace if we have exactly 1 match
  		if len(res) > 0 && len(res[0]) == 2 {
  			username = res[0][1]
  			text = strings.Replace(text, res[0][0], "", 1)
  		}
  	}
  	return username, text, nil
  }
docs: // extractNick searches for a username (based on "search" a regular expression).
  // if this matches it extracts a nick (based on "extract" another regular expression) from text
  // and replaces username with this result.
  // returns error if the regexp doesn't compile.