Logo Lanfrica

emdCatalyst/dzpnp

Domain:

digital infrastructure

Record type:

software
Creator:
emd
Host:
Phone number parsing , region detection and operator detection for algerian numbers dzpnp DZ (alpha 2 code for algeria) p hone n umber p rocessing . Parsing , region detection and operator detection for algerian numbers Star this project if you're interested :) ## Features - Support for all of algeria's current mobile operators. - Support for all algerian wilayas. - Simple and beginner friendly. - Well documented with examples. - Flexible, easy to expand when a new operator hits the scene. - No third party packages used, pure JavaScript and regular expressions. ## Getting started 1 - Install the package via npm npm install dzpnp 2 - Refer to the docs for more in depth descriptions and usage. ## The regex magic The regular expressions behind this project are actually very simple and very straight forward, everything is explained in the sections below. ### Initial processing - Remove the country/local codes Here is a diagram about it ### Determine the wilaya/provider - Select the first digit on the processed version. - Compare with the list of operator/wilaya Here is a very simplified diagram (same trick goes for the provider) ## Contributing Pull requests and issues are always welcome , irrelevant or non-useful ones will be closed. ## Copyright Copyright (c) 2020 Copyright Holder All Rights Reserved. Inspired by py-dz-phone-number .