在VIM语法文件中,如何在结束比赛中使用开始比赛?

| 在VIM语法文件中,可以编写如下的语法区域匹配项:
syn region xqString start=+\'+ end=+\'+
syn region xqString start=+\"+ end=+\"+
我要写的是
syn region xqString start=+([\'\"])+ end=+\\1+
其中\\ 1是开始处找到的匹配项。有关如何执行此操作或如果无法执行此操作的任何答案?     
已邀请:
        见
:help :syn-ext-match
  外部比赛:syn-ext-match      这些额外的正则表达式项在区域模式中可用:
        */\\z(* */\\z(\\)* *E50* *E52*
\\z(\\) Marks the sub-expression as \"external\", meaning that it is can
be accessed from another pattern match.  Currently only usable
in defining a syntax region start pattern.

      */\\z1* */\\z2* */\\z3* */\\z4* */\\z5*
\\z1  ...  \\z9     */\\z6* */\\z7* */\\z8* */\\z9* *E66* *E67*
Matches the same string that was matched by the corresponding
sub-expression in a previous start pattern match.
所以你可以做
syn region xqString start=+\\z([\'\"]\\)+ skip=+\\\\.+ end=+\\z1+
    

要回复问题请先登录注册