npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

regexpattern-collection

v1.0.1

Published

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

Downloads

24

Readme

Regex-Pattern

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

Version

Installation

npm i regexpattern-collection

Usage

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

RegexValidation.hasMatch("[email protected]", RegexPattern.email);//true
RegexValidation.hasMatch("yourcrush", RegexPattern.email);//false
  1. TypeScript
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 | Url that contains http/https | |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.pdfExtension | PDF Extension | pdf | |RegexPattern.binary | Binrary | binary numbers | |RegexPattern.currency | Currency | country currency |

License

MIT