File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 44
55A 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
1816var 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
3038MIT
You can’t perform that action at this time.
0 commit comments