Skip to main content

@std/regexp@1.0.0
Built and signed on GitHub Actions

Utilities for working with RegExp

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
5 months ago (1.0.0)

Functions for tasks related to regular expression (regexp), such as escaping text for interpolation into a regexp.

import { escape } from "@std/regexp/escape";
import { assertEquals, assertMatch, assertNotMatch } from "@std/assert";

const re = new RegExp(`^${escape(".")}$`, "u");

assertEquals("^\\.$", re.source);
assertMatch(".", re);
assertNotMatch("a", re);
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@std/regexp

Import symbol

import * as regexp from "@std/regexp";

---- OR ----

Import directly with a jsr specifier

import * as regexp from "jsr:@std/regexp";

Add Package

npx jsr add @std/regexp

Import symbol

import * as regexp from "@std/regexp";

Add Package

yarn dlx jsr add @std/regexp

Import symbol

import * as regexp from "@std/regexp";

Add Package

pnpm dlx jsr add @std/regexp

Import symbol

import * as regexp from "@std/regexp";

Add Package

bunx jsr add @std/regexp

Import symbol

import * as regexp from "@std/regexp";