代码之家  ›  专栏  ›  技术社区  ›  rhettg

Textmate空白突出显示

  •  0
  • rhettg  · 技术社区  · 15 年前

    here 通过在其他空行上不突出显示空白。

    我在Python语言文件中对此进行了修改:

            {   match = '(\s+)$';
            captures = { 1 = { name = 'invalid.whitespace'; }; };
        },
    

    为此:

            {   match = '\S(\s+)$';
            captures = { 1 = { name = 'invalid.whitespace'; }; };
        },
    

    这个新表达式似乎不再匹配任何内容。我做错了什么?

    2 回复  |  直到 7 年前
        1
  •  1
  •   Lily Ballard    15 年前

        2
  •  1
  •   Kornel    15 年前

    尝试断言:

    (?<=\S)\s+$
    

    PHP manual (当然,它们不是特定于PHP的,只是PHP.net恰好有一个可读性很强的文档版本)。