code: func IsCreditCard(str string) bool {
  	r, _ := regexp.Compile("[^0-9]+")
  	sanitized := r.ReplaceAll([]byte(str), []byte(""))
  	if !rxCreditCard.MatchString(string(sanitized)) {
  		return false
  	}
  	var sum int64
  	var digit string
  	var tmpNum int64
  	var shouldDouble bool
  	for i := len(sanitized) - 1; i >= 0; i-- {
  		digit = string(sanitized[i:(i + 1)])
  		tmpNum, _ = ToInt(digit)
  		if shouldDouble {
  			tmpNum *= 2
  			if tmpNum >= 10 {
  				sum += ((tmpNum % 10) + 1)
  			} else {
  				sum += tmpNum
  			}
  		} else {
  			sum += tmpNum
  		}
  		shouldDouble = !shouldDouble
  	}
  
  	if sum%10 == 0 {
  		return true
  	}
  	return false
  }
docs: // IsCreditCard check if the string is a credit card.