Get string between brackets¶ Suppose you need to extract the string between two braces, eg. - [[some-string]] Regex to match it would be: \[\[(.*?)\]\] vimscript regex to extract it would be: matchstr(getline('.'), '.*\[\[\zs.*\ze\]\]')