在记事本++中找到所有以`console`开头的行

find all lines that begin with `console` in notepad++

如何在记事本++中找到所有以console开头的行? 在单词 console

之前可以有零到任意数量的空格或制表符

假设我有一个文件如下:

    'createdRow': function (row, data, index) {
        console.log("data is: "); console.log(data);
        fields=Object.keys(data)
        console.log("fields is: "); console.log(fields);
        noOfFields=fields.length
        console.log("noOfFields is: "); console.log(noOfFields);

        var highlightVal = 80;
        var highlightClassName = 'highlight';
        var counterIndexCount = 4;

        for (var i=1; i <= counterIndexCount; i++) {
            if (parseInt(data['counter'+ i].substring(0,2), 10) >= highlightVal) {
                $('td', row).eq(i).addClass(highlightClassName);
            } else {
                $('td', row).eq(i).removeClass(highlightClassName);
            }
        }

我想我可能必须使用查找搜索左下方的“扩展”选项来执行类似 \n console 的操作。但无法让它工作。

供我参考: 类似问题在这里问

做一个regex(正则表达式)搜索这个:

^( |\t)*console

^匹配行首; ( |\t)* 匹配任意数量的制表符或空格;当然,console 与您要查找的文本匹配。

如果要匹配整行,在末尾添加.*

^( |\t)*console.*

输入Ctrl+H

然后在搜索window:

查找内容:^\s*console\b

然后单击在当前文档中查找全部
您会在查找结果 window.

中找到这些行
^        : Begining of line
\s*      : 0 or more any kind of space character
console  : literally 'console'
\b       : word boundary to make sure that is not matching 'consolefoobar'