On this page
@std/regexp
Overview Jump to heading
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);
Add to your project Jump to heading
deno add jsr:@std/regexp