Skip to content

Commit

Permalink
feat(extractCardNumber): added 3 more acceptable keywords in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-master authored Oct 31, 2020
1 parent 191e75c commit 9e34d78
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/modules/extractCardNumbers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,22 @@ function extractCardNumber(
* 2. 5022291070873466
* 3. ۵۰۲۲۲۹۱۰۸۱۸۷۳۴۶۶
* 4. ۵۰۲۲-۲۹۱۰-۷۰۸۷-۳۴۶۶
* 5. ۵۰۲۲.۲۹۱۰.۷۰۸۷.۳۴۶۶
* 6. ۵۰۲۲_۲۹۱۰_۷۰۸۷_۳۴۶۶
* 7. ۵۰۲۲*۲۹۱۰*۷۰۸۷*۳۴۶۶
*
* Acceptable keywords between numbers are:
* 1. Start -> *
* 2. Underscore -> _
* 3. Dash -> -
* 4. Dot -> .
* @example:
* 5022*2910_7087-3466
*
* @constant
* @type regex
*/
const cardNumberRegex = /([\u06F0-\u06F90-9-]{16,20})/gm;
const cardNumberRegex = /([\u06F0-\u06F90-9-_.\*]{16,20})/gm;
/**
* Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
*
Expand Down

0 comments on commit 9e34d78

Please sign in to comment.