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

x/ddc_vim/deps.ts>fn.glob2regpat

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.glob2regpat
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { glob2regpat } = fn;

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 {string} 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
string: unknown

Returns

Promise<string>