Skip to main content
Module

x/dpp_vim/deps.ts>fn.matchstr

Dark powered plugin manager for Vim/neovim
Latest
function fn.matchstr
import { fn } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";
const { matchstr } = fn;

Same as match(), but return the matched string. Example:

:echo matchstr("testing", "ing")

results in "ing". When there is no match "" is returned. The {start}, if given, has the same meaning as for match().

:echo matchstr("testing", "ing", 2)

results in "ing".

:echo matchstr("testing", "ing", 5)

result is "". When {expr} is a List then the matching item is returned. The type isn't changed, it's not necessarily a String.

Can also be used as a method:

GetText()->matchstr('word')

Parameters

denops: Denops
expr: unknown
pat: unknown
optional
start: unknown
optional
count: unknown

Returns

Promise<string>