Skip to content

Commit 67bafa8

Browse files
committed
Update the readme
1 parent 4144188 commit 67bafa8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
A regular expression for matching phone numbers.
66

7-
In the near future this will be likely moved to <https://github.com/regexps>.
8-
97
## Installation
108

119
```
@@ -17,14 +15,24 @@ npm i --save phone-regex
1715
```javascript
1816
var phone = require('phone-regex');
1917

20-
phone().test('1234567890') // => true
21-
phone().test('kljhsdf') // => false
18+
// Exact string option
19+
phone({ exact: true }).test('1234567890') // => true
20+
phone({ exact: true }).test('apple 1234567890') // => false
21+
22+
// Global option (default)
23+
phone().test('1234567890') // => true
24+
phone().test('apple 1234567890') // => true
25+
phone().test('apple') // => false
2226
```
2327

2428
## Acknowledgements
2529

2630
* Regex from <http://stackoverflow.com/a/16702965/1378668>.
2731

32+
## TODO
33+
34+
- [ ] Don't let the regex match strings with whitespace, `" 1234567890 "`, with the exact option.
35+
2836
## License
2937

3038
MIT

0 commit comments

Comments
 (0)