JSPM

@utilify/regex

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q10761F
  • License MIT

The Regex Utilities provide methods for validating common patterns such as email addresses, URLs, UUIDs, and more.

Package Exports

  • @utilify/regex
  • @utilify/regex/dist/index.cjs
  • @utilify/regex/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@utilify/regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Regex Utilities

The Regex Utilities provide methods for validating common patterns such as email addresses, URLs, UUIDs, and more.


Installation

To install the regex utilities package, use the appropriate command:

npm install @utilify/regex
yarn add @utilify/regex
pnpm add @utilify/regex

Import the functions into your project:

import { isAlpha, isAlphanumeric, isEmail, isURL } from '@utilify/regex';
const { isAlpha, isAlphanumeric, isEmail, isURL } = require('@utilify/regex');

Available Functions

isAlpha

function isAlpha(value: string): boolean;

Checks if the string contains only letters (a-z and A-Z).


isAlphanumeric

function isAlphanumeric(value: string): boolean;

Checks if the string contains only letters and numbers (a-z, A-Z, 0-9).


isBase64

function isBase64(value: string): boolean;

Checks if the string is encoded in Base64 format.


isCreditCard

function isCreditCard(value: string): boolean;

Checks if the string follows the pattern of a valid credit card number.


isEmail

function isEmail(value: string): boolean;

Checks if the string is a valid email address.


isIPV4

function isIPV4(value: string): boolean;

Checks if the string is an IPv4 address.


isIPV6

function isIPV6(value: string): boolean;

Checks if the string is an IPv6 address.


isSlug

function isSlug(value: string): boolean;

Checks if the string is in a URL-friendly slug format.


isURL

function isURL(value: string): boolean;

Checks if the string is a valid URL.


isUUID

function isUUID(value: string): boolean;

Checks if the string follows the format of a valid UUID.