This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
//: Basic implementation to apply different regexes over a card number String and find the card type | |
enum CardType:String, CustomStringConvertible { | |
case invalid = "Not valid" | |
case visa = "^4[0-9]{6,}$" | |
case mastercard = "^5[0-9]{6,}$" | |
case amex = "^3[47][0-9]{13}$" | |
case diners = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |