Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto O. Fernández Crisial rofc

View GitHub Profile
View gist:a999529c0d2fca3c8408c5910a8dc26b
# Based on https://baymard.com/checkout-usability/credit-card-patterns
ALL TOGETHER
============
(?:4[0-9]{3}(?:[\ -]?[0-9]{4}){3})|(?:4(?:026|405|508|844|913|917)[-\ ]?[0-9]{4}|4175[-\ ]?00[0-9]{2})(?:[-\ ]?[0-9]{4}){2}|(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)(?:[-\ ]?[0-9]{4}){3}|3[47][0-9]{2}[-\ ]?[0-9]{6}[-\ ]?[0-9]{5}|62[0-9]{2}[-\ ]?(?:[-\ ]?[0-9]{4}){3}|62[0-9]{4}[-\ ]?[0-9]{13}|(?:5[0678][0-9]{2}|6[0-9]{3})[-\ ]?[0-9]{4}[-\ ]?[0-9]{5}|(?:5[0678][0-9]{2}|6[0-9]{3})[-\ ]?[0-9]{6}[-\ ]?[0-9]{5}|(?:5[0678][0-9]{2}|6[0-9]{3})(?:[-\ ]?[0-9]{4}){3}|(?:5[0678][0-9]{2}|6[0-9]{3})(?:[-\ ]?[0-9]{4}){3}[-\ ]?[0-9]{3}|(?:30[0123459][0-9]|3[689][0-9]{2})[-\ ]?[0-9]{6}[-\ ]?[0-9]{4}|5[45][0-9]{2}(?:[-\ ]?[0-9]{4}){3}|(?:6011[-\ ]?[0-9]{4}|6221[-\ ]?2[6-9][0-9]{2}|6221[-\ ]?[3-9][0-9]{3}|622[2-8][-\ ]?[0-9]{4}|6229[-\ ]?[01][0-9]{3}|6229[-\ ]?2[0-5][0-9]{2})(?:[-\ ]?[0-9]{4}){2}|(?:352[89]|35[3-7][0-9]|358[0-9])(?:[-\ ]?[0-9]{4}){3}|1[0-9]{3}[-\ ]?[0-9]{5}[-\ ]?[0-9]{6}|5019(?:[-\ ]?[
@rofc
rofc / git_svn_bash_prompt.sh
Last active Aug 15, 2018 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to git/svn branch, and return status of last command.
View git_svn_bash_prompt.sh
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE: