Socket
Book a DemoInstallSign in
Socket

regexpattern-collection

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexpattern-collection

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

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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

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

RegexValidation.hasMatch("yourcrush@mail.com", RegexPattern.email);//true
RegexValidation.hasMatch("yourcrush", RegexPattern.email);//false
  • TypeScript
import { RegexValidation, RegexPattern } from "regexpattern-collection"

RegexValidation.hasMatch("yourcrush@mail.com", RegexPattern.email);//true

Regex Pattern Collection

PatternTypeDescription
RegexPattern.emailEmailEmail
RegexPattern.userNameUsernamethat may include _ and – having a length of 3 to 16 characters
RegexPattern.urlUrlUrl that contains http/https
RegexPattern.numberOnlyNumber Onlyonly contains numbers
RegexPattern.decimalNumberDecimal Numberonly contains decimal
RegexPattern.htmltagHTML Tagonly contains html tag
RegexPattern.htmltagMD5 Hashonly contains md5
RegexPattern.bitcoinaddressBitcoin Addressonly contains bitcoin address
RegexPattern.ipaddressIP Addressonly contains ip address
RegexPattern.ipv4addressIPV4 Addressonly contains ipv4 address
RegexPattern.ipv6addressIPV6 Addressonly contains ipv6 address
RegexPattern.dateDatewill match a string as a date in the formats M/D/YY, M/D/YYY, MM/DD/YY, and MM/DD/YYYY
RegexPattern.time12hoursTime 12 HoursTime Format HH:MM 12-hour, optional leading 0
RegexPattern.time24hoursTime 24 HoursTime Format HH:MM 24-hour, optional leading 0
RegexPattern.duplicateStringDuplicate Stringduplicate string
RegexPattern.slugSlugslug
RegexPattern.passportPassportpassport
RegexPattern.passwordComplexPassword ComplexShould have 1 lowercase letter, 1 uppercase letter, 1 number, 1 special character and be at least 8 characters long
RegexPattern.passwordModeratePassword ModerateShould have 1 lowercase letter, 1 uppercase letter, 1 number and be at least 8 characters long
RegexPattern.filenameWithExtensionFile Name With Extensionsupport all extension (mp4, mp3, wav, png, jpg, gif, etc.)
RegexPattern.imageExtensionImage Extensionjpeg,jpg,gif,png,bmp
RegexPattern.audioExtensionAudio Extensionmp3,wav,wma,amr,ogg
RegexPattern.videoExtensionVideo Extensionmp4,avi,wmv,rmvb,mpg,mpeg,3gp
RegexPattern.pdfExtensionPDF Extensionpdf
RegexPattern.binaryBinrarybinary numbers
RegexPattern.currencyCurrencycountry currency

License

MIT

Keywords

regex

FAQs

Package last updated on 23 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.