<?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[User Defined Language]]></title><description><![CDATA[<p dir="auto">Hello, I am currently trying to make my User Defined Language highlight some words depending on the context using delimiters but one of my delimiters ended up overlapping the other. I wanted to make different styles based on the parenthesis, like () and [] is one style and (] and [) is another style. The words in these (), [], [) and (] would also turned into that color based on the parenthesis. Therefore, I could not get the result I wanted. Is there a way to get what I am trying to achieve?</p>
<p dir="auto">What I am trying to achieve:</p>
<p dir="auto">[words] or (words) =&gt; would be in orange color<br />
<img src="/assets/uploads/files/1694349036515-0ffc25c8-b126-44d1-aa45-0a71bbf9b981-image.png" alt="0ffc25c8-b126-44d1-aa45-0a71bbf9b981-image.png" class=" img-fluid img-markdown" /><br />
(words] or [words) =&gt; would be in green color<br />
<img src="/assets/uploads/files/1694349024958-83f1a37a-ff0e-4ab2-9ee0-917ef166468d-image.png" alt="83f1a37a-ff0e-4ab2-9ee0-917ef166468d-image.png" class=" img-fluid img-markdown" /><br />
But the result i got was</p>
<p dir="auto">(words] or [words] ended up being orange color<br />
[words] and (words) were not affected<br />
<img src="/assets/uploads/files/1694349053614-e8117dd7-c63c-4ae4-b750-9b98a15c537a-image.png" alt="e8117dd7-c63c-4ae4-b750-9b98a15c537a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24902/user-defined-language</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 19:35:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24902.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Sep 2023 12:31:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to User Defined Language on Sun, 10 Sep 2023 18:45:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/eileen-ling" aria-label="Profile: Eileen-Ling">@<bdi>Eileen-Ling</bdi></a> ,</p>
<p dir="auto">With just the User Defined Language (UDL) syntax, what you want is probably not achievable.</p>
<p dir="auto">However, if you install the EnhanceAnyLexer plugin (using <strong>Plugins &gt; Admin</strong> tool), then you can make sure your file has the right UDL active, then use <strong>Plugins &gt; EnhanceAnyLexer &gt; Enhance Current Language</strong> to edit the plugin’s config file.  You can then define foreground color changes using “0xBBGGRR = regex” pairs.</p>
<p dir="auto"><img src="/assets/uploads/files/1694371087249-32d726da-3676-466c-b50b-0f889bb555b6-image.png" alt="32d726da-3676-466c-b50b-0f889bb555b6-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-ini">[udf]
; color each word, 0x66ad1 is the color used, see the description above for more information on the color coding.
0x0080FF = \([^)\\&rsqb;&rsqb;*?\)
0x0080FF = \\&lsqb;&lsqb;^)\\&rsqb;&rsqb;*?\\]
0x00FF80 = \([^)\\&rsqb;&rsqb;*?\\]
0x00FF80 = \\&lsqb;&lsqb;^)\\&rsqb;&rsqb;*?\)
; check in the respective styler xml if the following IDs are valid
excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
</code></pre>
<p dir="auto">In my example, I defined four regular expressions: two will match the balanced `` and <code>(...)</code>; the other two match the imbalanced <code>[...)</code> and <code>(...]</code></p>
<p dir="auto">If you don’t want it to match multiline, change each of those four regex to have <code>\r\n</code> right after the <code>^</code>, so that it doesn’t look for parenthesized text that spans across newline characters.</p>
<p dir="auto"><em>note</em>: mine used <code>[udf]</code> as the header, because I was in an unnamed UDL.  If you follow my instructions above, yours will have <code>[YourUdlNameHere]</code> instead.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89178</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89178</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 10 Sep 2023 18:45:59 GMT</pubDate></item></channel></rss>