Created
May 14, 2020 08:10
-
-
Save kpol/293a40363a3f53ab335a96708b150b33 to your computer and use it in GitHub Desktop.
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
(?x) | |
(?<![0-9]) | |
(?: | |
[0-9]{12,19} # sequence of digits in the text between [12, 19] length | |
| | |
(?:[0-9]{4}[ -]){4}[0-9]{3} # 4-4-4-4-3 pattern | |
| | |
(?:[0-9]{4}[ -]){3}[0-9]{4} # 4-4-4-4 pattern | |
| | |
(?:[0-9]{4}[ -]){2}[0-9]{5} # 4-4-5 pattern | |
| | |
[0-9]{4}[ -][0-9]{6}[ -][0-9]{4,5} # 4-6-4 or 4-6-5 pattern | |
| | |
[0-9]{4}[ -][0-9]{5}[ -][0-9]{6} # 4-5-6 pattern | |
| | |
[0-9]{6}[ -][0-9]{13} # 6-13 pattern | |
) | |
(?![0-9]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment