<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Automatic highlighting of lines containing a specific string?]]></title><description><![CDATA[<p dir="auto">I use notepad++ to view PHP error log files. We have a lot of logging in place for analytics and such, and it tends to obscure important stuff.</p>
<p dir="auto">An average log entry looks like this - prepended with a time and location stamp:</p>
<p dir="auto"><strong>[25-Sep-2018 18:22:55 US/Central] error information goes here</strong></p>
<p dir="auto">When I add logging specifically for debugging purposes, I prepend my log string with +++, so it would look like this:</p>
<p dir="auto"><strong>[25-Sep-2018 18:22:55 US/Central]+++ test</strong></p>
<p dir="auto">Is there any way to automatically change the formatting (color, specifically) of any line that contains the +++ string? Like maybe set the foreground color to white and the background to red.</p>
<p dir="auto">I was fiddling a bit with the user-defined language settings, but can’t figure out how to manage this specific setup, since it’s not a line opener or delimiter.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16386/automatic-highlighting-of-lines-containing-a-specific-string</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 08:07:41 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16386.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Sep 2018 23:53:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 23:30:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/esther-strom" aria-label="Profile: Esther-Strom">@<bdi>Esther-Strom</bdi></a> said:</p>
<blockquote>
<p dir="auto">there are some hacks to sort of get close to what I want</p>
</blockquote>
<p dir="auto">Well, if you’re going to be super-fussy about it… :-) …I’d probably say we aren’t out of good options with Notepad++ yet…maybe stay tuned…but I might say perhaps you aren’t using the right tool for the right job.</p>
<p dir="auto">Everybody wants Notepad++ to be great at everything, but it’s really just great at its core duty:  text editing.  It isn’t great at searching…it isn’t great at log-file monitoring…it isn’t great at hex-editing…the list goes on and on.</p>
<p dir="auto">For this specific example, probably something like <a href="https://glogg.bonnefon.org/index.html" rel="nofollow ugc">glogg</a> meets your need better than Notepad++…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35119</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35119</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 23:30:16 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 21:18:13 GMT]]></title><description><![CDATA[<p dir="auto">Thanks to everyone for the answers. What I’m getting is that there are some hacks to <em>sort of</em> get close to what I want to do, but nothing that will get me automatic highlighting without running a macro every time I open the file, or the open file changes.</p>
<p dir="auto">Back to BareTail, I guess.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35118</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35118</guid><dc:creator><![CDATA[Esther Strom]]></dc:creator><pubDate>Wed, 26 Sep 2018 21:18:13 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 17:38:06 GMT]]></title><description><![CDATA[<p dir="auto">So my thinking was the above (red)marking action might be recorded into a macro and tied to a keystroke, maybe ctrl+shift+e (whatever).  Then when you want the highlighting, you press the keycombo.  Then it occurred to me that it might also be desirable to remove the (red)marking with another keystroke, maybe ctrl+shift+alt+e (again, whatever).</p>
<p dir="auto">However, when I did some experimenting, I found out that a press of the <strong>Clear</strong> button on the <strong>Mark</strong> tab of the Find window doesn’t get recorded into a macro.</p>
<p dir="auto"><em><strong>Side note:</strong></em>  This has been reported long ago as a Notepad++ <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/1948" rel="nofollow ugc">issue</a>, see “Case I”.  Maybe it has also been discussed on the Community before as well…memory fails…</p>
<p dir="auto">Worse yet than not being able to record it, you can’t hand-edit the file in which the macros are stored in order to make it work (this technique works in some other instances).</p>
<p dir="auto">In short, you can’t clear (red)marking in any other way than bringing up the <strong>Mark</strong> window and pressing the <strong>Clear</strong> button. Or can you??</p>
<p dir="auto">Well, if you’ll notice, the <strong>Mark</strong> window has an option for <strong>Purge for each search</strong>.  Activating (ticking) this option means that when you run a new (red)marking operation, before Notepad++ runs it, it will erase all of the existing (red)marking.  So if we just can find a <strong>Find what</strong> value which will never match anything, we should have a means to clear all existing (red)marking.  I settled upon the following, wrapped into a complete solution:</p>
<p dir="auto"><strong>Find what</strong> zone: <code>\A\z</code><br />
<strong>Purge for each search</strong> checkbox: ticked<br />
<strong>Wrap around</strong> checkbox: ticked<br />
<strong>In selection</strong> checkbox: unticked<br />
<strong>Search mode</strong> setting: Regular expression<br />
Action:  Press the <strong>Find All</strong> button</p>
<p dir="auto">This action is recordable into a macro, thus it <em>IS</em> possible to assign a “clear (red)marking” command to a keycombo.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35114</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35114</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 17:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 12:53:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a> said:</p>
<blockquote>
<p dir="auto">Wrap around checkbox: ticked or unticked, as you like</p>
</blockquote>
<p dir="auto">Slight revision to the above:  I would definitely <em><strong>tick</strong></em> the <strong>Wrap around</strong> checkbox for this!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35109</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35109</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 12:53:29 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 12:40:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/esther-strom" aria-label="Profile: Esther-Strom">@<bdi>Esther-Strom</bdi></a></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> makes a good point about “bookmarks”, which will give you additional functionality.</p>
<p dir="auto">If you add <strong>Mark line</strong> (tick the checkbox) into the <strong>Mark</strong> search you can quickly jump between your debug messages which would be very handy when your file is large.  See <strong>Search</strong> (menu) -&gt; <strong>Bookmark</strong> -&gt; <strong>Next Bookmark</strong> (and of course also <strong>Previous Bookmark</strong>).  [Technically you don’t need bookmarks to do this, as you can quickly move to redmarked text using <strong>Search</strong> (menu) -&gt; <strong>Jump Down</strong> (or <strong>Up</strong>) -&gt; <strong>Find Style</strong>.]</p>
<p dir="auto">If you want to copy all of the lines touched by the redmarking, bookmarks help here:  See <strong>Search</strong> (menu) -&gt; <strong>Bookmark</strong> -&gt; <strong>Copy Bookmarked Lines</strong></p>
]]></description><link>https://community.notepad-plus-plus.org/post/35107</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35107</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 12:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 12:29:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/esther-strom" aria-label="Profile: Esther-Strom">@<bdi>Esther-Strom</bdi></a></p>
<p dir="auto">UDL might be one approach, but when I have a quick need for something like this, I record a <strong>Mark</strong> action to a macro and then tie that macro to a keycombination.  Then when I need the highlighting, or to refresh it, I just hit the keycombo and the highlighting pops in.</p>
<p dir="auto">Here’s how I might do yours:</p>
<p dir="auto">Invoke <strong>Mark</strong> dialog (<strong>Search</strong> (menu) -&gt; <strong>Mark…</strong>)<br />
<strong>Find what</strong> zone: <code>^\[\d{2}-\w{3}-\d{4}\x20\d{2}:\d{2}:\d{2}\x20US/Central\]\+{3}\x20(?-s).+</code><br />
<strong>Wrap around</strong> checkbox: ticked or unticked, as you like<br />
<strong>Search mode</strong> selection: <em>Regular expression</em><br />
Action: Press <strong>Find All</strong> button</p>
<p dir="auto">Of course, having macro recording running when the button is pressed is what makes this truly useful…the assumption here is you know how to record, name and save macros…</p>
<p dir="auto">When executed, this “marking” will cause a red background to appear for your debug string; example:</p>
<p dir="auto"><img src="https://camo.nodebb.org/18d1426930fbc11f6ec16c8f2c90e04b9da60cc7?url=https%3A%2F%2Fi.imgur.com%2FuBYIRWW.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">In case you are curious or want to modify it, here’s how the <strong>Find what</strong> expression works:</p>
<ul>
<li>[Assert position at the beginning of a line (at beginning of the string or after a line break character) (carriage return and line feed, form feed)][<em><strong>1</strong></em> ] <code>^</code></li>
<li>[Match the character “[” literally][<em><strong>2</strong></em> ] <code>\[</code></li>
<li>[Match a single character that is a “digit” (any symbol with a decimal value in the active code page)][<em><strong>3</strong></em> ] <code>\d{2}</code>
<ul>
<li>[Exactly 2 times][<em><strong>4</strong></em> ] <code>{2}</code></li>
</ul>
</li>
<li>[Match the character “-” literally][<em><strong>5</strong></em> ] <code>-</code></li>
<li>[Match a single character that is a “word character” (letter, digit, or underscore in the active code page)][<em><strong>3</strong></em> ] <code>\w{3}</code>
<ul>
<li>[Exactly 3 times][<em><strong>4</strong></em> ] <code>{3}</code></li>
</ul>
</li>
<li>[Match the character “-” literally][<em><strong>5</strong></em> ] <code>-</code></li>
<li>[Match a single character that is a “digit” (any symbol with a decimal value in the active code page)][<em><strong>3</strong></em> ] <code>\d{4}</code>
<ul>
<li>[Exactly 4 times][<em><strong>4</strong></em> ] <code>{4}</code></li>
</ul>
</li>
<li>[Match the character “ ” which occupies position 0x20 (32 decimal) in the character set][<em><strong>6</strong></em> ] <code>\x20</code></li>
<li>[Match a single character that is a “digit” (any symbol with a decimal value in the active code page)][<em><strong>3</strong></em> ] <code>\d{2}</code>
<ul>
<li>[Exactly 2 times][<em><strong>4</strong></em> ] <code>{2}</code></li>
</ul>
</li>
<li>[Match the colon character][<em><strong>5</strong></em> ] <code>:</code></li>
<li>[Match a single character that is a “digit” (any symbol with a decimal value in the active code page)][<em><strong>3</strong></em> ] <code>\d{2}</code>
<ul>
<li>[Exactly 2 times][<em><strong>4</strong></em> ] <code>{2}</code></li>
</ul>
</li>
<li>[Match the colon character][<em><strong>5</strong></em> ] <code>:</code></li>
<li>[Match a single character that is a “digit” (any symbol with a decimal value in the active code page)][<em><strong>3</strong></em> ] <code>\d{2}</code>
<ul>
<li>[Exactly 2 times][<em><strong>4</strong></em> ] <code>{2}</code></li>
</ul>
</li>
<li>[Match the character “ ” which occupies position 0x20 (32 decimal) in the character set][<em><strong>6</strong></em> ] <code>\x20</code></li>
<li>[Match the character string “US/Central” literally (case sensitive)][<em><strong>5</strong></em> ] <code>US/Central</code></li>
<li>[Match the character “]” literally][<em><strong>2</strong></em> ] <code>\]</code></li>
<li>[Match the character “+” literally][<em><strong>2</strong></em> ] <code>\+{3}</code>
<ul>
<li>[Exactly 3 times][<em><strong>4</strong></em> ] <code>{3}</code></li>
</ul>
</li>
<li>[Match the character “ ” which occupies position 0x20 (32 decimal) in the character set][<em><strong>6</strong></em> ] <code>\x20</code></li>
<li>[Use these options for the remainder of the regular expression][<em><strong>7</strong></em> ] <code>(?-s)</code>
<ul>
<li>[(hyphen inverts the meaning of the letters that follow)][<em><strong>7</strong></em> ] <code>-</code></li>
<li>[Dot doesn’t match line breaks][<em><strong>7</strong></em> ] <code>s</code></li>
</ul>
</li>
<li>[Match any single character that is NOT a line break character (line feed, carriage return, form feed)][<em><strong>8</strong></em> ] <code>.+</code>
<ul>
<li>[Between one and unlimited times, as many times as possible, giving back as needed (greedy)][<em><strong>9</strong></em> ] <code>+</code></li>
</ul>
</li>
</ul>
<p dir="auto">Created with <a href="http://www.regexbuddy.com/" rel="nofollow ugc">RegexBuddy</a></p>
<p dir="auto">[<em><strong>1</strong></em> ]: <a href="http://www.regular-expressions.info/anchors.html" rel="nofollow ugc">http://www.regular-expressions.info/anchors.html</a><br />
[<em><strong>2</strong></em> ]: <a href="http://www.regular-expressions.info/characters.html#special" rel="nofollow ugc">http://www.regular-expressions.info/characters.html#special</a><br />
[<em><strong>3</strong></em> ]: <a href="http://www.regular-expressions.info/shorthand.html" rel="nofollow ugc">http://www.regular-expressions.info/shorthand.html</a><br />
[<em><strong>4</strong></em> ]: <a href="http://www.regular-expressions.info/repeat.html#limit" rel="nofollow ugc">http://www.regular-expressions.info/repeat.html#limit</a><br />
[<em><strong>5</strong></em> ]: <a href="http://www.regular-expressions.info/characters.html" rel="nofollow ugc">http://www.regular-expressions.info/characters.html</a><br />
[<em><strong>6</strong></em> ]: <a href="http://www.regular-expressions.info/nonprint.html" rel="nofollow ugc">http://www.regular-expressions.info/nonprint.html</a><br />
[<em><strong>7</strong></em> ]: <a href="http://www.regular-expressions.info/modifiers.html" rel="nofollow ugc">http://www.regular-expressions.info/modifiers.html</a><br />
[<em><strong>8</strong></em> ]: <a href="http://www.regular-expressions.info/dot.html" rel="nofollow ugc">http://www.regular-expressions.info/dot.html</a><br />
[<em><strong>9</strong></em> ]: <a href="http://www.regular-expressions.info/repeat.html" rel="nofollow ugc">http://www.regular-expressions.info/repeat.html</a></p>
<p dir="auto">RegexBuddy settings to emulate N++ regex engine: Application=boost::regex 1.54-1.57 / flavor=Default flavor / replacement flavor=All flavor / ^$ match at line breaks / Numbered capture / Allow zero-length matches</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35105</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35105</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 12:29:08 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic highlighting of lines containing a specific string? on Wed, 26 Sep 2018 12:28:45 GMT]]></title><description><![CDATA[<p dir="auto">Maybe the marking feature of the search function could be helpful for you. It marks only the search strings found but it is also able to set bookmarks at these lines.</p>
<ol>
<li>Open the Search dialog and switch to the Mark tab.</li>
<li>Make sure that the following checkboxes have the specified state:<br />
a) Bookmark line -&gt; checked<br />
b) Purge for each search -&gt; checked<br />
c) Match whole word only -&gt; unchecked</li>
<li>Set Search mode to Normal</li>
</ol>
<p dir="auto">After hitting the “Mark all” button you will be able to navigate with F2/Shift+F2 between the lines containing your search string.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35104</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35104</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Wed, 26 Sep 2018 12:28:45 GMT</pubDate></item></channel></rss>