Skip to main content
Module

x/denops_std/function/mod.ts>glob2regpat

📚 Standard module for denops.vim
Go to Latest
function glob2regpat
import { glob2regpat } from "https://deno.land/x/denops_std@v3.7.0/function/mod.ts";

Convert a file pattern, as used by glob(), into a search pattern. The result can be used to match with a string that is a file name. E.g. if filename =~ glob2regpat('Make*.mak') This is equivalent to: if filename =~ '^Make.*.mak$' When {expr} is an empty string the result is "^$", match an empty string. Note that the result depends on the system. On MS-Windows a backslash usually means a path separator. Can also be used as a |method|: GetExpr()->glob2regpat()

Parameters

denops: Denops
expr: unknown

Returns

Promise<unknown>