Skip to content

CreditCards

Giuseppe Cannella edited this page Feb 19, 2020 · 2 revisions
Type name example
Visa 4111111111111
import com.github.gekomad.regexcollection._
import com.github.gekomad.regexcollection.Validate.validate

assert(validate[CreditCardVisa]("411111a111111") == None)
assert(validate[CreditCardVisa]("4111111111111111") == Some("4111111111111111"))
assert(validate[CreditCardVisa]("4111111111111") == Some("4111111111111"))
assert(validate[CreditCardMasterCard]("5500000000000004") == Some("5500000000000004"))
assert(validate[CreditCardAmericanExpress]("340000000000009") == Some("340000000000009"))
assert(validate[CreditCardinersClub]("30000000000004") == Some("30000000000004"))
assert(validate[CreditCardDiscover]("6011000000000004") == Some("6011000000000004"))
assert(validate[CreditCardJCB]("3588000000000009") == Some("3588000000000009"))
Clone this wiki locally