<?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[Regex help: CSS comments as function names in FunctionList]]></title><description><![CDATA[<p dir="auto">I organise rules in my CSS files with comments, so using them to navigate a file via Function List works well for me. I came up with this in functionList.xml:</p>
<pre><code>&lt;association langID="20" id="css_function"/&gt;
</code></pre>
<p dir="auto">…</p>
<pre><code>&lt;parser id="css_function" displayName="CSS" commentExpr=""&gt;
	&lt;function mainExpr="/\*(.*?)\*/" displayMode="$functionName"&gt;
		&lt;functionName&gt;
			&lt;nameExpr expr=".*"/&gt;
		&lt;/functionName&gt;
	&lt;/function&gt;
&lt;/parser&gt;
</code></pre>
<p dir="auto">giving me a function list that looks like this:</p>
<ul>
<li>/* nav menu */</li>
<li>/* ads */</li>
<li>/* pink outline */</li>
<li>/* search widget */</li>
</ul>
<p dir="auto">Which is fine and useful, but not quite what I want. I’m trying to achieve simply this:</p>
<ul>
<li>nav menu</li>
<li>ads</li>
<li>pink outline</li>
<li>search widget</li>
</ul>
<p dir="auto">How do I do it?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/10711/regex-help-css-comments-as-function-names-in-functionlist</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 07:09:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/10711.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Oct 2015 07:56:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex help: CSS comments as function names in FunctionList on Mon, 26 Oct 2015 02:41:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks guy038 for the solution and explanation. Cheers</p>
]]></description><link>https://community.notepad-plus-plus.org/post/11869</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/11869</guid><dc:creator><![CDATA[Lionel Wong]]></dc:creator><pubDate>Mon, 26 Oct 2015 02:41:04 GMT</pubDate></item><item><title><![CDATA[Reply to Regex help: CSS comments as function names in FunctionList on Sun, 29 Nov 2020 00:14:23 GMT]]></title><description><![CDATA[<p dir="auto">Hello <strong>Lionel</strong>,</p>
<p dir="auto">To <strong>ONLY</strong> get, in your <strong>Function List</strong> window, the <strong>contents</strong> of the comments, <strong>without</strong> the <strong>delimiters</strong> and some <strong>extra blank</strong> characters, before and after them, just change the <strong>nameExpr</strong> line into :</p>
<p dir="auto"><strong><code>&lt;nameExpr expr="(?-s)/\* *\K.*?(?= *\*/)"/&gt;</code></strong></p>
<p dir="auto"><strong>Explanations</strong> :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(?-s)</code></strong> syntax forces the <strong>dot</strong> symbol to represent a <strong>standard</strong> character only ( not an <strong>EOL</strong> character )</p>
</li>
<li>
<p dir="auto">The <strong>first</strong> part of this regex, <strong><code>/\* *</code></strong> matches the string <strong><code>/*</code></strong>, followed by the <strong>longest</strong> range, even <strong>null</strong>, of <strong>spaces</strong></p>
</li>
<li>
<p dir="auto">The <strong><code>\K</code></strong> is a special syntax that tell the regex engine to <strong>forget</strong> everything that was <strong>previously</strong> matched. So, the <strong>final</strong> regex will begin to match the <strong>first non blank</strong> character after the <strong>start</strong> delimiter <strong><code>/*</code></strong></p>
</li>
<li>
<p dir="auto">The <strong>final</strong> part of this regex <strong><code>(?= *\*/)</code></strong>, is a <strong>look-ahead</strong> construction, which must be verified to get a <strong>positive</strong> match, but which is <strong>NEVER</strong> part of a regex. The regex of this <strong>look-ahead</strong>, that is to be verified, is the <strong>longest</strong> range, even <strong>null</strong>, of <strong>space</strong> characters, followed by the string <strong><code>*/</code></strong></p>
</li>
<li>
<p dir="auto">The <strong>middle</strong> part of this regex  <strong><code>.*?</code></strong> is the <strong>shortest</strong> range of characters between the <strong>first</strong> and the <strong>final</strong> parts, of the regex, which are to be written in the <strong>Function List</strong> window</p>
</li>
</ul>
<p dir="auto">That should be work nice !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/11852</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/11852</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 29 Nov 2020 00:14:23 GMT</pubDate></item></channel></rss>