Skip to content

Commit f7490ad

Browse files
committed
Minor tweaks
1 parent 57c61f8 commit f7490ad

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

readme.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
> Regular expression for matching credit card numbers
44
5+
56
## Install
67

7-
```sh
8+
```
89
$ npm install --save credit-card-regex
910
```
1011

12+
1113
## Usage
1214

1315
```js
@@ -26,6 +28,22 @@ creditCardRegex({exact: true}).test('6011881485017922');
2628
//=> ['6011881485017922', '5441068611005540']
2729
```
2830

31+
32+
## API
33+
34+
### creditCardRegex(options)
35+
36+
Returns a regex for matching credit card numbers.
37+
38+
#### options.exact
39+
40+
Type: `boolean`
41+
Default: `false` *(Matches any credit card number in a string)*
42+
43+
Only match an exact string.
44+
Useful with `RegExp#test` to check if a string is a credit card number.
45+
46+
2947
## License
3048

3149
MIT © [Kevin Mårtensson](https://github.com/kevva)

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
var creditCardRegex = require('../');
43
var test = require('ava');
4+
var creditCardRegex = require('../');
55

66
test('match credit card numbers', function (t) {
77
var fixtures = [].concat(

0 commit comments

Comments
 (0)