JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36931F
  • License MIT

A simple library with common Zimbabwean regex patterns

Package Exports

  • simple-regex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

��# Simple Regex [![npm version](https://badge.fury.io/js/simple-regex.svg)](https://badge.fury.io/js/simple-regex) A simple package with common regex pattens for Zimbabwe ## 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