Giter VIP home page Giter VIP logo

basemax / iranian-phonenumber-validator-nodejs Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 21 KB

A library for validating Iranian phone numbers in nodejs that can help you to extract all phone numbers from a text, check if a text has a phone number, check if a text is exactly a phone number, check if a text includes a special phone number.

License: GNU General Public License v3.0

JavaScript 100.00%
iran iranian javascript js node nodejs phone-number phone-number-validation phone-number-validator phonenumber

iranian-phonenumber-validator-nodejs's Introduction

iranian-phonenumber-validator-nodejs

A library for validating Iranian phone numbers in nodejs that can help you to extract all phone numbers from a text, check if a text has a phone number, check if a text is exactly a phone number, check if a text includes a special phone number.

Features

  • Extract all phone numbers from a text
  • Check if a text has a phone number
  • Check if a text is excatly a phone number
  • Check if a text includes a special phone number

Using

Import the library in your project:

const iranian_phonenumber_validator = require("./iranian-phonenumber-validator");

Then you can extract all phone numbers from a text:

console.log(iranian_phonenumber_validator.match("09124561010 sdfsdfsdfsdfsd xxxxx 09134445588 09108886666 +989131615645 9108886666"));

Or you can check if a text has a phone number:

console.log(iranian_phonenumber_validator.has("1 09124561010 2"));

Or you can check if a text is excatly a phone number:

console.log(iranian_phonenumber_validator.exact("!!!!"));
console.log(iranian_phonenumber_validator.exact("09124561010"));

Or you can check if a text includes a special phone number:

console.log(iranian_phonenumber_validator.includes("first 09124561010 second google.com sallam.org bye.net", "09124561010"));
console.log(iranian_phonenumber_validator.includes("first https://google.com/first/second/third second google.com sallam.org bye.net", "09124561010"));

Copyright 2023, Max Base

iranian-phonenumber-validator-nodejs's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.