/deno-vim-regexp

Convert from Vim's regular expression format to JavaScript RegExp.

Primary LanguageTypeScriptMIT LicenseMIT

deno-vim-regexp

license:MIT jsr Test codecov

This module provides a conversion from Vim's regular expression format to Javascript's RegExp.

Example

import { VimRegExp } from "@milly/vimregexp/regexp";
import { assert, assertFalse } from "@std/assert";

const regex = new VimRegExp(
  "\\k\\+",
  {
    iskeyword: "@,48-57,_,192-255",
    flags: "i",
  },
);

assert(regex.test("Foo"));
assertFalse(regex.test("!!!"));