2.0.0-alpha.1 • Published 4 years ago

simple-regex v2.0.0-alpha.1

Weekly downloads
103
License
MIT
Repository
github
Last release
4 years ago

Simple Regex

npm version A simple package with common regex pattens for Zimbabwe

Links

Simple Regex Documentation

Github Repository

NPM Package

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(<your-variable>). 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 <input type="text" name="number_plate" pattern={SimpleRegex.NumberPlate} title="Zimbabwean Number Plate">

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

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)

2.0.0-alpha.1

4 years ago

1.1.3

4 years ago

1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago