Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/abc/vendor/https/deno.land/std/path/mod.ts>globToRegExp

A better Deno framework to create web application.
Go to Latest
function globToRegExp
import { globToRegExp } from "https://deno.land/x/abc@v1.0.3/vendor/https/deno.land/std/path/mod.ts";

Convert a glob string to a regular expressions.

 // Looking for all the `ts` files:
 walkSync(".", {
   match: [globToRegExp("*.ts")]
 });

 Looking for all the `.json` files in any subfolder:
 walkSync(".", {
   match: [globToRegExp(join("a", "**", "*.json"), {
     extended: true,
     globstar: true
   })]
 });

Parameters

glob: string
optional
unnamed 1: GlobToRegExpOptions = [UNSUPPORTED]

Returns

RegExp