1.1.2 • Published 5 years ago

@michaeldera/simple-regex v1.1.2

Weekly downloads
67
License
MIT
Repository
github
Last release
5 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">

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

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago