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

regular-expression-utility

v2.0.0

Published

I help you to use regular expressions already defined.!

Downloads

41

Readme

regular-expression-utility

I help you to use regular expressions already defined.

Install

npm install --save regular-expression-utility

Usage

import React from "react";
import Utility, { Expression } from "regular-expression-utility";

const Home = () => {
  return <>{Utility.test(Expression.PASSWORD, "wMH432595@") ? "Yes" : "NO"}</>;
};

or

import React from "react";
import Utility from "regular-expression-utility";

const Home = () => {
  return (
    <>{Utility.test(new RegExp("^[0-9]+$"), "a8888") ? "Yes" : "NO"}</>
  );
};

Expression

PASSWORD: "This regular expression validates a strong password that must have a lowercase letter, an uppercase letter, a number, a special character and a minimum of 8 digits"

HEX_COLOR: "This regular expression validates a hexadecimal color."

RGB_COLOR: "This regular expression validates a rgb color."

EMAIL: "This regular expression validates an email."

IPV4: "This regular expression validates an IP 4."

IPV6: "This regular expression validates an IP 6."

TELEPHONE_NUMBER: "This regular expression validates a valid phone number."

TELEPHONE_EXTENSION_NUMBER: "This regular expression validates a valid phone with its extension."

MM_DD_YYYY: "This regular expression validates a valid date in the format: MM-DD-YYYY"

DD_MM_YYY: "This regular expression validates a valid date in the format: DD-MM-YYY"

YYYY_MM_DD: "This regular expression validates a valid date in the format: YYYY-MM-DD"

POSTAL_CODE: "This regular expression validates a valid postal code."

TWITTER_USERNAME: "This regular expression validates a valid twitter username."

CREDIT_CARD: "This regular expression validates a valid credit card."

WHITE_SPACE : "This regular expression checks if a text string contains whitespace."

ONLY_NUMBERS: "This regular expression checks if a text string contains only numbers."

ONLY_LETTERS: "This regular expression checks if a text string contains only letters."

NUMBERS_BETWEEN_1_100: "This regular expression checks if a text string is a number from 1 to 100."

LETTERS_WITH_SPACES: "This regular expression checks if a text string contains only letters and whitespace."

LETTERS_AND_NUMBERS: "This regular expression checks if a text string contains only letters and numbers."

INTEGERS_AND_DECIMALS_NUMBERS: "This regular expression checks if a text string is an integer or a decimal."

POSITIVE_AND_NEGATIVE_INTEGER_NUMBERS: "This regular expression tests whether a text string is a positive or negative integer."

HOUR_FORMAT_12: "This regular expression checks if a text string is a valid time in 12-hour format."

HOUR_FORMAT_24: "This regular expression checks if a text string is a valid time in 24-hour format."

USERNAME: "This regular expression validates usernames with lowercase letters, numbers, underscores, and underscores. Usernames must be between 3 and 16 characters."

URL: "This regular expression validates a URL."

SQL: "This regular expression validates a SQL."

HTML_TAG: "This regular expression checks if an html tag is valid."

SLUG: "This regular expression checks if a text string contains letters, numbers and the special character -."

ISBN: "This regular expression validates a International Standard Book Number (ISBN)."

License

MIT © [Rafael Mayor Alberto].