Coder Social home page Coder Social logo

febryardiansyah / regex-pattern Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 3.0 204 KB

A simple Javascript & TypeScript module of Regex Pattern Collection for String Validation

Home Page: https://www.npmjs.com/package/regexpattern-collection

License: MIT License

TypeScript 100.00%
regex-pattern typescript javascript validator email-validator hacktoberfest

regex-pattern's Introduction

Regex-Pattern



A simple Javascript & TypeScript module of Regex Pattern Collection for String Validation


Version GitHub GitHub last commit

Installation

npm i regexpattern-collection

Usage

  1. CommonJs
const { RegexValidation, RegexPattern } = require("regexpattern-collection").default;

RegexValidation.hasMatch("[email protected]", RegexPattern.email);//true
RegexValidation.hasMatch("yourcrush", RegexPattern.email);//false
  1. ES6
import { RegexValidation, RegexPattern } from "regexpattern-collection"

RegexValidation.hasMatch("[email protected]", RegexPattern.email);//true

Regex Pattern Collection

Pattern Type Description
RegexPattern.email Email email
RegexPattern.userName Username that may include _ and โ€“ having a length of 3 to 16 characters
RegexPattern.url Url any url (https://, ftps://, tg://, zoommtg://, etc)
RegexPattern.webUrl Web URL http,https
RegexPattern.fileUrl File URL afp,ftp,ftps,smb,sftp,ssh,dav,davs
RegexPattern.numberOnly Number Only only contains numbers
RegexPattern.decimalNumber Decimal Number only contains decimal
RegexPattern.htmltag HTML Tag only contains html tag
RegexPattern.htmltag MD5 Hash only contains md5
RegexPattern.bitcoinaddress Bitcoin Address only contains bitcoin address
RegexPattern.ipaddress IP Address only contains ip address
RegexPattern.ipv4address IPV4 Address only contains ipv4 address
RegexPattern.ipv6address IPV6 Address only contains ipv6 address
RegexPattern.date Date will match a string as a date in the formats M/D/YY, M/D/YYY, MM/DD/YY, and MM/DD/YYYY
RegexPattern.time12hours Time 12 Hours Time Format HH:MM 12-hour, optional leading 0
RegexPattern.time24hours Time 24 Hours Time Format HH:MM 24-hour, optional leading 0
RegexPattern.duplicateString Duplicate String duplicate string
RegexPattern.slug Slug slug
RegexPattern.passport Passport passport
RegexPattern.passwordComplex Password Complex Should have 1 lowercase letter, 1 uppercase letter, 1 number, 1 special character and be at least 8 characters long
RegexPattern.passwordModerate Password Moderate Should have 1 lowercase letter, 1 uppercase letter, 1 number and be at least 8 characters long
RegexPattern.filenameWithExtension File Name With Extension support all extension (mp4, mp3, wav, png, jpg, gif, etc.)
RegexPattern.imageExtension Image Extension jpeg,jpg,gif,png,bmp
RegexPattern.audioExtension Audio Extension mp3,wav,wma,amr,ogg
RegexPattern.videoExtension Video Extension mp4,avi,wmv,rmvb,mpg,mpeg,3gp
RegexPattern.ocExtension OC Extension xlsx,xls,csv
RegexPattern.pdfExtension PDF Extension pdf
RegexPattern.binary Binrary binary numbers
RegexPattern.base64 Base64 Base64 format
RegexPattern.jwt JWT JSON Web Token format
RegexPattern.currency Currency country currency

License

MIT

regex-pattern's People

Contributors

febryardiansyah avatar rairizky avatar rivanfebrian123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

regex-pattern's Issues

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.