https://github.com/tiaanduplessis/sa-number-regex
Regular expression for matching South African Cellphone numbers
https://github.com/tiaanduplessis/sa-number-regex
cellphone pattern regex south-africa
Last synced: 2 months ago
JSON representation
Regular expression for matching South African Cellphone numbers
- Host: GitHub
- URL: https://github.com/tiaanduplessis/sa-number-regex
- Owner: tiaanduplessis
- License: mit
- Created: 2018-03-30T18:15:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-02T22:50:08.000Z (over 6 years ago)
- Last Synced: 2025-08-02T22:30:44.414Z (2 months ago)
- Topics: cellphone, pattern, regex, south-africa
- Language: JavaScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sa-number-regex
[](https://npmjs.org/package/sa-number-regex)
[](https://npmjs.org/package/sa-number-regex)
[](https://github.com/RichardLitt/standard-readme)
[](https://npmjs.org/package/sa-number-regex)
[](http://makeapullrequest.com)> Regular expression for matching South African Cellphone numbers
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#License)## Install
This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).
```sh
$ npm install sa-number-regex
$ # OR
$ yarn add sa-number-regex
```## Usage
```js
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
4. Submit a pull request## License
MIT