Socket
Socket
Sign inDemoInstall

phone-regex

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    phone-regex

Regular expression for phone numbers.


Version published
Weekly downloads
2.1K
decreased by-11.36%
Maintainers
2
Install size
8.07 kB
Created
Weekly downloads
 

Readme

Source

Phone Regex

Build Status

A regular expression for matching phone numbers.

Installation

npm i --save phone-regex

Usage

var phone = require('phone-regex');

// Exact string option
phone({ exact: true }).test('1234567890')       // => true
phone({ exact: true }).test('apple 1234567890') // => false

// Global option (default)
phone().test('1234567890')       // => true
phone().test('apple 1234567890') // => true
phone().test('apple')            // => false

// Indian option
phone({ indian: true }).test('mango 9744142626')              // => true
phone({ indian: true }).test('mango 1234567890')              // => false
phone({ indian: true, exact: true }).test('mango 9744142626') // => false

Acknowledgements

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander. Support for Indian Numbers added by Livin Mathew.

Keywords

FAQs

Last updated on 23 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc