<?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[How to highlight certain words by color?]]></title><description><![CDATA[<p dir="auto">I’m from Russia, do not swear for my knowledge of English :3<br />
I want to highlight some words in color in the .yml file</p>
<p dir="auto">This <a href="https://ibb.co/jpCXYz" rel="nofollow ugc">picture</a> will explain everything.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16137/how-to-highlight-certain-words-by-color</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 03:50:43 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16137.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Aug 2018 12:19:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to highlight certain words by color? on Wed, 08 Aug 2018 22:06:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12735">@Сергей-Копышев</a></p>
<p dir="auto">see <a href="https://notepad-plus-plus.org/community/topic/16125/colored-keywords-in-xml/10" rel="nofollow ugc">here </a>what could be done.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34032</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34032</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Wed, 08 Aug 2018 22:06:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight certain words by color? on Tue, 07 Aug 2018 15:45:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12735">@Сергей-Копышев</a> ,</p>
<p dir="auto">Doing it manually, you could highlight all the first-level keys, then <code>Search &gt; Mark All &gt; Using First Style</code>; then highlight all the second-level keys, and mark all using second style, etc… but I bet you want it more automated than that.  (it’s hard to say, because a picture, though helpful, does not explain everything). Using these numbered styles, you would be limited to 5 different stylings.</p>
<p dir="auto">I know you can use the Mark menu (<code>Search &gt; Mark...</code>) and a regex to match some groups of those… but I think that makes a “bookmark”, not a “styled mark”.  I don’t know how to convert that “bookmark” into one of the “styled marks”.  (I have never used the Mark or Bookmark features, except when answering questions on these forums, and that only rarely.  I think <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> and/or <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3662">@Claudia-Frank</a> know a lot more about the marking features than I do.)</p>
<p dir="auto">For example, given text similar to what you showed, I was able to use the following regular expressions in <strong>Find what</strong> to select the first- or second- or third-level keys (I don’t know the YAML terminology for the “key” of a <code>key: value</code> pair – though the <a href="https://en.wikipedia.org/wiki/YAML" rel="nofollow ugc">wikipedia:YAML</a> article seems to imply that it’s <code>key: value</code>, which is common terminology for hashes; so I’ll stick with that.  You might think of it as a “name” or a “label” or something else, too.)</p>
<p dir="auto">With options: <code>☑ Purge for each line</code>, <code>☑ Regular Expression</code></p>
<ul>
<li>level-1 key regex = <code>^\w+(?=:)</code>
<ul>
<li><code>^</code> = beginning of line,</li>
<li><code>\w+</code> = one or more word characters (alphanumeric or underscore <code>_</code>); no spaces allowed</li>
<li><code>(?=:)</code> = make sure the word characters are followed by the literal colon, but don’t include the colon in the marking (this is pretty advanced: it’s called a look-ahead)</li>
<li>=&gt; this marks the “EXEC” from your image</li>
</ul>
</li>
<li>level-2 key regex = <code>^  \K\w+(?=:)</code>
<ul>
<li><code>^  \K</code> = beginning of line, with two literal spaces.  The <code>\K</code> “throws away” everything before, so the spaces won’t be part of the text that’s marked</li>
<li><code>\w+</code> = same as before</li>
<li><code>(?=:)</code> = same as before</li>
<li>=&gt; this marks “Scan_2”</li>
</ul>
</li>
<li>level-3 key regex = <code>^    \K\w+(?=:)</code> marked), then match one or more word characters and the colon)
<ul>
<li><code>^    \K</code> = beginning of line, with four literal spaces.</li>
<li>everything else is the same as before</li>
</ul>
</li>
<li>all the %blah% text: <code>%[^%]+%</code>
<ul>
<li><code>%</code> = literal percent</li>
<li><code>[^%]+</code> = one or more characters that aren’t a literal <code>%</code></li>
<li><code>%</code> = literal percent</li>
<li>if, instead, you want it limited to “word characters”, with no spaces or fancy characters, between the percents: <code>%\w+%</code></li>
</ul>
</li>
</ul>
<p dir="auto">FYI: Please study some of the links found in <a href="https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation" rel="nofollow ugc">FAQ DESK: Where To Find RegEx Docs</a> to learn more about regular expressions.</p>
<p dir="auto">If you want to be able to automatically convert the bookmarked lines to specific Mark style-numbers, Guy or Claudia might chime in.  It would probably involve automation using PythonScript or LuaScript if <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3662">@Claudia-Frank</a> answers; <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> might be able to do it solely with regular expressions, though even he might resort to scripting.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34012</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34012</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 07 Aug 2018 15:45:34 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight certain words by color? on Tue, 07 Aug 2018 14:33:44 GMT]]></title><description><![CDATA[<p dir="auto">спроси на форумер рубоард в теме Notepad++</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34009</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34009</guid><dc:creator><![CDATA[AZJIO AZJIO]]></dc:creator><pubDate>Tue, 07 Aug 2018 14:33:44 GMT</pubDate></item></channel></rss>