<?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 do I create a new User Defined Language &quot;based on&quot; an existing one ?]]></title><description><![CDATA[<p dir="auto">I’d like to create a new user defined language based on the exisitng C++ one.<br />
I tried copying the Cpp.xml file and making changes in the header (name etc.) but Notepadd++ didn’t pick that up.</p>
<p dir="auto">How do I do it?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23289/how-do-i-create-a-new-user-defined-language-based-on-an-existing-one</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 13:41:18 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23289.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Jul 2022 16:22:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Tue, 26 Jul 2022 19:26:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a></p>
<p dir="auto">see <a href="https://community.notepad-plus-plus.org/topic/23306/enhanceanylexer-plugin">here</a> for the news :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78714</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78714</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 26 Jul 2022 19:26:29 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Tue, 26 Jul 2022 08:28:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a> said in <a href="/post/78680">How do I create a new User Defined Language "based on" an existing one ?</a>:</p>
<blockquote>
<p dir="auto">;0x00FF00 = (?&lt;=void\h+)\w+</p>
</blockquote>
<p dir="auto">EnhanceAnyLexer uses what Npp uses, there is no own regex implementation.<br />
I have been thinking about this problem and will implement a function to notify about invalid regex.<br />
I am thinking of something like this</p>
<p dir="auto"><img src="/assets/uploads/files/1658823550619-94072f3c-bd74-49c7-8397-e4ff2a22abc3-image.png" alt="94072f3c-bd74-49c7-8397-e4ff2a22abc3-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/78690</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78690</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 26 Jul 2022 08:28:39 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 18:46:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a> said in <a href="/post/78680">How do I create a new User Defined Language "based on" an existing one ?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Thanks…<br />
This line for void is not working.<br />
;0x00FF00 = (?&lt;=void\h+)\w+</p>
</blockquote>
<p dir="auto">With a semicolon, it won’t , because that comments out that line of the config file.  I am assuming you don’t actually have that semicolon there.</p>
<p dir="auto">That said, the reason it didn’t work, even without the semicolon, is because I didn’t try it myself, and I forgot that lookbehinds have to be fixed-length, but <code>\h+</code> is not fixed-length.  If you know it will always be exactly one space, then change the regex to <code>(?&lt;=void\h)\w+</code> … but if you need to allow any number of spaces or tabs between void and the word, then use <code>void\h+\K\w+</code> instead; if you want void and the word to also allow linebreaks between (which are valid in c/c++, and even meet some of the style guides out there, though I dislike that style, personally), then <code>void\s+\K\w+</code> will work.  (I tested all three of these before posting, this time).</p>
<blockquote>
<p dir="auto">Is there a reference guide to the regular expressions and what  they mean ?  I didn’t see one on his github.</p>
</blockquote>
<p dir="auto">I think that it’s using boost regular expressions, which match what is available to Notepad++, so you can look at the <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ regex docs</a>.  But <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> can chime in if a different regex library is being used.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78681</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78681</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 25 Jul 2022 18:46:42 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 18:35:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Thanks…<br />
This line for void is not working.<br />
;0x00FF00 = (?&lt;=void\h+)\w+</p>
<p dir="auto">Is there a reference guide to the regular expressions and what  they mean ?  I didn’t see one on his github.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78680</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78680</guid><dc:creator><![CDATA[Chal Chinehsoyo]]></dc:creator><pubDate>Mon, 25 Jul 2022 18:35:51 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 18:17:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a> ,</p>
<p dir="auto">The EnhanceAnyLexer will only affect foreground colour.  It cannot change background colour; it cannot make matched text bold, italic, or underlined; it cannot change the font size or font name.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78677</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78677</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 25 Jul 2022 18:17:37 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 17:31:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/78672">How do I create a new User Defined Language "based on" an existing one ?</a>:</p>
<blockquote>
<p dir="auto">[c++]<br />
0x0000FF = M_\w+<br />
0x00FF00 = (?&lt;=void\h+)\w+</p>
</blockquote>
<p dir="auto">Great, thats working for me : )<br />
I changed the colour of the word as you described above.<br />
Is there anyway of making it <strong>bold</strong> ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78675</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78675</guid><dc:creator><![CDATA[Chal Chinehsoyo]]></dc:creator><pubDate>Mon, 25 Jul 2022 17:31:59 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 15:29:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a></p>
<blockquote>
<p dir="auto">But, is there anyway to change this Style’s colours?</p>
</blockquote>
<p dir="auto">Yes, using the Style Configurator, as I said.  Use this dialog, with <code>C++</code> selected on the left, and cycle through all the entries in the <strong>Style</strong> column and edit the Colour Style for any that you want to change.<br />
<img src="/assets/uploads/files/1658762687686-0d990290-1eb1-4992-b971-718b160b0017-image.png" alt="0d990290-1eb1-4992-b971-718b160b0017-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Or if you really want to punish yourself by editing the raw XML, you can edit <code>%AppData%\Notepad++\stylers.xml</code> if you have the default style selected – though you will need to follow the <a href="https://npp-user-manual.org/docs/config-files/#editing-configuration-files" rel="nofollow ugc">Editing Configuration File</a> advice in the Online User Manual if you want to do that.  (Your location for that file may be different, <a href="https://npp-user-manual.org/docs/config-files/#configuration-files-location" rel="nofollow ugc">depending on your configuration</a>)</p>
<blockquote>
<p dir="auto">Is it C:\Program Files\Notepad++\stylers.model.xml ?</p>
</blockquote>
<p dir="auto">That is the default version of <code>stylers.xml</code> that Notepad++ will copy into <code>%AppData%\Notepad++\stylers.xml</code>(or equivalent) if it doesn’t find <code>stylers.xml</code> in the right place.  Changing that file will not help if you already have a copy of <code>stylers.xml</code> in the right place, because changes to stylers.model.xml do not automatically propagate to stylers.xml.</p>
<blockquote>
<p dir="auto">Also, is it possible in Notepad++ to tell it to change the colour of any word beginning with “M_” for example.<br />
Or the colour of the word following, for example, "void " ?</p>
</blockquote>
<p dir="auto">Not without a plugin.  The Enhance Any Lexer would allow you to specify colors in GBR format (0xGGBBRR) on the left of the equals and a regex for what.  The following configuration for EnhanceAnyLexer will make <code>M_...</code> be red and the word after <code>void</code> be blue, in addition to the styles that the C++ lexer already applies.</p>
<pre><code>[c++]
0x0000FF = M_\w+
0x00FF00 = (?&lt;=void\h+)\w+
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/78672</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78672</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 25 Jul 2022 15:29:05 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Mon, 25 Jul 2022 15:09:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/78618">How do I create a new User Defined Language "based on" an existing one ?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a> ,</p>
<p dir="auto">The <strong>Settings &gt; Style Configurator</strong> is where you set the per-language colors for any of the builtin lexer languages.</p>
</blockquote>
<p dir="auto">I’ve settled with using C++ language.<br />
But, is there anyway to change this Style’s colours?  Is there a file in the resources directories I can edit somehow?<br />
Is it C:\Program Files\Notepad++\stylers.model.xml ?</p>
<p dir="auto">Also, is it possible in Notepad++ to tell it to change the colour of any word beginning with “M_” for example.</p>
<p dir="auto">Or the colour of the word following, for example, "void " ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78671</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78671</guid><dc:creator><![CDATA[Chal Chinehsoyo]]></dc:creator><pubDate>Mon, 25 Jul 2022 15:09:56 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Sat, 23 Jul 2022 23:07:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> ah ok, that makes sense thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78625</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78625</guid><dc:creator><![CDATA[Chal Chinehsoyo]]></dc:creator><pubDate>Sat, 23 Jul 2022 23:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Sat, 23 Jul 2022 17:09:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a> ,</p>
<p dir="auto">The <strong>Settings &gt; Style Configurator</strong> is where you set the per-language colors for any of the builtin lexer languages.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78618</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78618</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 23 Jul 2022 17:09:19 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Sat, 23 Jul 2022 16:42:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> thanks… really I’d just like to change certain colours in the C++ one.<br />
But there seems to be no way of doing that, like you can in the User Defined Language section.   Is there?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78617</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78617</guid><dc:creator><![CDATA[Chal Chinehsoyo]]></dc:creator><pubDate>Sat, 23 Jul 2022 16:42:16 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create a new User Defined Language &quot;based on&quot; an existing one ? on Sat, 23 Jul 2022 16:34:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chal-chinehsoyo" aria-label="Profile: Chal-Chinehsoyo">@<bdi>Chal-Chinehsoyo</bdi></a></p>
<p dir="auto">Existing lexer languages are a completely different creature than UDL, so you cannot start a UDL from an existing language (like C++).</p>
<p dir="auto">If you are just wanting to add extra keywords to the C++, use the types that have user-defined boxes in some of their keyword definitions in the Style Configurator.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78616</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78616</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 23 Jul 2022 16:34:13 GMT</pubDate></item></channel></rss>