2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-05-11 07:26:51 +00:00
|
|
|
// This module is browser compatible.
|
|
|
|
|
|
|
|
/**
|
2024-02-12 20:32:41 +00:00
|
|
|
* 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.
|
2023-05-11 07:26:51 +00:00
|
|
|
*
|
2024-05-21 16:43:25 +00:00
|
|
|
* ```ts
|
2024-07-12 08:07:33 +00:00
|
|
|
* import { escape } from "@std/regexp/escape";
|
2024-05-21 16:43:25 +00:00
|
|
|
* import { assertEquals, assertMatch, assertNotMatch } from "@std/assert";
|
|
|
|
*
|
|
|
|
* const re = new RegExp(`^${escape(".")}$`, "u");
|
|
|
|
*
|
|
|
|
* assertEquals("^\\.$", re.source);
|
|
|
|
* assertMatch(".", re);
|
|
|
|
* assertNotMatch("a", re);
|
|
|
|
* ```
|
2024-06-11 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @module
|
2023-05-11 07:26:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
export * from "./escape.ts";
|