mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
24 lines
639 B
TypeScript
24 lines
639 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
/**
|
|
* Functions for tasks related to
|
|
* {@link https://en.wikipedia.org/wiki/Regular_expression | regular expression} (regexp),
|
|
* such as escaping text for interpolation into a regexp.
|
|
*
|
|
* ```ts
|
|
* 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);
|
|
* ```
|
|
*
|
|
* @module
|
|
*/
|
|
|
|
export * from "./escape.ts";
|