1.0.0 • Published 6 years ago

sa-number-regex v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

sa-number-regex

package version package downloads standard-readme compliant package license make a pull request

Regular expression for matching South African Cellphone numbers

Table of Contents

Install

This project uses node and npm.

$ npm install sa-number-regex
$ # OR
$ yarn add sa-number-regex

Usage

const saNumberRegex = require('sa-number-regex')

console.log(saNumberRegex({exact: true}).test('0749585337')) // true
console.log(saNumberRegex({exact: true}).test('0833597957')) // true
console.log(saNumberRegex({exact: true}).test('0845017368')) // true

The exact argument only match an exact string. Default is global.

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature' 3.Push to the branch: git push origin my-new-feature
  3. Submit a pull request

License

MIT