Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex Textmate空白突出显示_Regex_Textmate - Fatal编程技术网

Regex Textmate空白突出显示

Regex Textmate空白突出显示,regex,textmate,Regex,Textmate,我想修改高亮显示尾随空格的解决方案,即不高亮显示空行上的空格 我在Python语言文件中对此进行了修改: { match = '(\s+)$'; captures = { 1 = { name = 'invalid.whitespace'; }; }; }, 为此: { match = '\S(\s+)$'; captures = { 1 = { name = 'invalid.whitespace'; }; };

我想修改高亮显示尾随空格的解决方案,即不高亮显示空行上的空格

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

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

        {   match = '\S(\s+)$';
        captures = { 1 = { name = 'invalid.whitespace'; }; };
    },
这个新表达式似乎不再匹配任何内容。我做错了什么?

尝试断言:

(?<=\S)\s+$

(?您的模式的问题是,前面的非空格字符可能已经与另一个规则匹配,因此您的规则不可用。使用porneL建议的断言是正确的方法。

啊,非常接近。它实际上是(?)?