Skip to content

astronomizedev/regexpkg

Repository files navigation

RegexPKG

version downloads

RegexPKG is a node module that provides helpful regexes for your package.

Using RegexPKG

To get started, download RegexPKG.

npm install regexpkg

Next, you can start using the API.

const regexpkg = require('regexpkg')

console.log(regexpkg.getAllRegexes()) // logs all the regexes in the library

console.log(regexpkg.test('String', '"Hello, World!"')) // returns true or false wether the regex matching the name matches the string.

console.log(regexpkg.Regex[<name>]) // Get a regex by name

console.log(regexpkg.Regex.<name>)  // Get a regex by name

List of Regexes(As of v1.0.11)

  • Number

    Matches a number/multiple numbers.

  • String

    Matches anything in between quotes.

  • Symbol

    Matches any symbol

  • Email

    Matches an email

  • Text

    Matches a line of text

  • IPV4

    Matches an IPV4 ip.

  • IPV6

    Matches an IPV6 ip.

  • PhoneNumber

    Matches a phone number

  • Password

    Matches a password with at least one lowercase letter, at least 1 uppercase letter, at least 1 number, at least 1 symbol, and that is 8 characters long.