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 🙏

© 2026 – Pkg Stats / Ryan Hefner

regex-simple-checks

v1.0.5

Published

Common regex checks that you can use in the JavaScript world without looking for them and making sure they work!

Readme

Common regex checks that you can use in the JavaScript world without looking for them on Google!

Features:

  • Some common regex checks that we all need to do sometimes. :blush:
  • Call the functions as per your need and a boolean value is returned.
  • Light weight package.
  • Many useful functions in the package.

How to install:

npm i regex-simple-checks

How to use:

  • Import the package into your application as usual
    • import {containOnlyLetters} from '@gurjinder7/regex-simple-checks'
  • Checking functions that return boolean:
    • containAnyDigits(pattern) - returns true is the pattern contains a digit
    • containsAnyNonWordCharacter(pattern) - returns true if the pattern contains any non word character.
      • This is a broad search for symbols and includes whitespace as well.
    • containOnlyLetters(pattern) - returns true if pattern contains only letters
    • containsNoSymbol(pattern) - returns true if patterns has no symbol
      • Can be used for alphanumeric pattern or only number and only digits patterns
    • containsAnySymbol(pattern) - returns true if one of the following symbol is there in the pattern
      • ~`!@#$%^&*()_-+=|\}{]["':;<,>.?/
    • containsThisSymbol(pattern, symbol) - returns true if the pattern contains the symbol.
      • containsThisSymbol("qwe%asd","%") - returns true
    • containsThisOrThatSymbol(pattern, symbol1, symbol2) - returns true if the pattern contains either of the symbols
      • containsThisOrThatSymbold("jhkgjh&kKJh","@","&") - returns true`
    • startsWithADigitAndEndsWithALetter(pattern) - returns true if the patterns starts and ends with one or more than one digit.
      • pattern : digits-letters
      • Eg: 12asdlkaskd,2asda etc.
    • startsWithALetterAndEndsWithADigit(pattern) - returns true if the pattern starts with a letter and ends with a digit.
      • one or more than one letter and one or more than one digit.
      • pattern : letters-digits
      • Eg: aada112,a2323,asda3
    • startsWithADigitAndEndsWithADigit(pattern) - returns true if the pattern start with a digit and ends with a digit.
      • one or more than one digit on both ends.
      • pattern : digits-letters-digits
      • Eg: 2asde2,23asdssad12
    • startsWithALetterAndEndsWithALetter(pattern) - returns true if the pattern start and ends with one or more letter.
      • pattern : letters-digits-letters
      • Eg; asd332asd, a32423432a
  • Match function that returns index:
    • firstDigitMatchIndex(pattern)- returns index of first match of the digit in the pattern, otherwise -1
    • firstNonWordMatchIndex(pattern)- returns index of first match of the non-word in the pattern, otherwise -1
    • firstWhiteSpaceMatchIndex(pattern)- returns index of first match of the white space in the pattern, otherwise -1
    • firstSymbolMatchIndex(pattern, symbol)- returns index of first match of the symbol argument in the pattern, otherwise -1

Note: make sure to send the argument(s) as needed otherwise regex passes the test on empty values and returns true.