https://github.com/michaeldera/simple-regex-ts
A simple package with common regex patterns for Zimbabwe
https://github.com/michaeldera/simple-regex-ts
npm npm-module npm-package regex regexp typescript zimbabwe
Last synced: 12 months ago
JSON representation
A simple package with common regex patterns for Zimbabwe
- Host: GitHub
- URL: https://github.com/michaeldera/simple-regex-ts
- Owner: michaeldera
- License: mit
- Created: 2019-07-28T07:55:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T12:12:56.000Z (about 2 years ago)
- Last Synced: 2025-06-27T07:49:04.674Z (12 months ago)
- Topics: npm, npm-module, npm-package, regex, regexp, typescript, zimbabwe
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/simple-regex
- Size: 10.1 MB
- Stars: 14
- Watchers: 3
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Simple Regex
[](https://badge.fury.io/js/simple-regex)
A simple package with common regex pattens for Zimbabwe
## Links
[Simple Regex Documentation](https://simple-regex.netlify.com/)
[Github Repository](https://github.com/michaeldera/simple-regex)
[NPM Package](https://www.npmjs.com/package/simple-regex)
## Installation
For npm users `npm i simple-regex`
For yarn users `yarn add simple-regex`
## Usage
To test a variable against a Regex expression:
`SimpleRegex.MobileNumber.Econet.test()`. This will return a `boolean` which indicates whether your variable matches the Regex Pattern.
You can also inject the Regex Pattern into HTML form fields. An example of this pattern in ReactJS
``
### Global Flag
Starting from version 2.0.0-alpha the package no longer has the global flag set by default. See [an issue about it here](https://github.com/michaeldera/simple-regex-ts/issues/8)
### Available Patterns
`SimpleRegex.MobileNumber.Econet` Pattern for Econet Mobile Numbers
`SimpleRegex.MobileNumber.Telecel` Pattern for Telecel Mobile Numbers
`SimpleRegex.MobileNumber.Netone` Pattern for Netone Mobile Numbers
`SimpleRegex.NumberPlate` Pattern for Zimbabwean National Vehicle Registration Numbers
`SimpleRegex.PassportNumber` Pattern for Zimbabwean Passport Numbers
`SimpleRegex.NationalId` Pattern for Zimbabwean National Identification Numbers
`SimpleRegex.EmailAddress` Pattern for Email Addresses
`SimpleRegex.DriversLicence` Pattern for Zimbabwean Driver's Licences
`SimpleRegex.SSN` Pattern for Zimbabwean Social Security Number (NSSA)
`SimpleRegex.DomainName` Pattern for Zimbabwean domain name