Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.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 匹配不带'的线;t以注释开头(在任意数量的选项卡之后)_Regex_Notepad++_Negative Lookahead - Fatal编程技术网

Regex 匹配不带'的线;t以注释开头(在任意数量的选项卡之后)

Regex 匹配不带'的线;t以注释开头(在任意数量的选项卡之后),regex,notepad++,negative-lookahead,Regex,Notepad++,Negative Lookahead,我使用负前瞻查找每一行不以注释开头(仅“/”),但在“/”符号之前可能有任意数量的选项卡 这是我的正则表达式(我正在使用记事本++): 示例:在此示例文件中: LineOfCode ... // Other Comment // Comments can contain every time of symbol, including "//", ".", etc. //

我使用负前瞻查找每一行不以注释开头(仅“/”),但在“/”符号之前可能有任意数量的选项卡

这是我的正则表达式(我正在使用记事本++):

示例:在此示例文件中:

                LineOfCode ...
                // Other Comment
                // Comments can contain every time of symbol, including "//", ".", etc.
                // /**
                    // Another comment ...
                // */
                Line Of Code ...
                    // .,.,-
只有第一行和第七行应该匹配,但对于我的正则表达式,它们都匹配。

使用

^(?!\h*//).*
^(?!\h*/)
先行匹配以0+水平空格开始的行,然后匹配
/
,然后匹配该行的其余部分

使用以下选项:

^(?!\h*//).*