Skip to content

Phone number parsing , region detection and operator detection for algerian numbers

License

Notifications You must be signed in to change notification settings

emdCatalyst/dzpnp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dzpnp

DZ (alpha 2 code for algeria) phone number processing . 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

Diagram1

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)

Diagram1

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.

About

Phone number parsing , region detection and operator detection for algerian numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published