" ingo/escape.vim: Functions to escape different strings. " " DEPENDENCIES: " " Copyright: (C) 2013-2017 Ingo Karkat " The VIM LICENSE applies to this script; see ':help copyright'. " " Maintainer: Ingo Karkat " " REVISION DATE REMARKS " 1.029.003 16-Dec-2016 Add ingo#escape#OnlyUnescaped(). " 1.017.002 20-Feb-2014 Add ingo#escape#UnescapeExpr(). " 1.009.001 15-Jun-2013 file creation function! ingo#escape#UnescapeExpr( string, expr ) "****************************************************************************** "* PURPOSE: " Remove a leading backslash before all matches of a:expr that occur in " a:string, and are not itself escaped. "* ASSUMPTIONS / PRECONDITIONS: " None. "* EFFECTS / POSTCONDITIONS: " None. "* INPUTS: " a:string The text to unescape. " a:expr Regular expression to unescape. "* RETURN VALUES: " Unescaped a:string. "****************************************************************************** return substitute(a:string, '\%(\%(^\|[^\\]\)\%(\\\\\)*\\\)\@