     public func typeFromString(string: String) -> T? {
         for type in types {
             let predicate = NSPredicate(format: "SELF MATCHES %@", type.regex)
-            if predicate.evaluateWithObject(string.onlyNumbers) {
+            let numbersString = self.onlyNumbersFromString(string)
+            if predicate.evaluateWithObject(numbersString) {
                 return type
             }
         }

    :returns: true or false
    */
    public func validateString(string: String) -> Bool {
        let numbers = string.onlyNumbers
        if count(numbers) < 9 {
            return false
        }

        return typeFromString(string) == type
    }
    
    public func onlyNumbersFromString(string: String) -> String {
        let set = NSCharacterSet.decimalDigitCharacterSet().invertedSet
        let numbers = string.componentsSeparatedByCharactersInSet(set)
        return "".join(numbers)
    }
    
    // MARK: - Loading data
    
    private static let types = [
        [
            "name": "Amex",
