<?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 needed editing the function list xml file]]></title><description><![CDATA[<p dir="auto">I am trying to edit the Notepad++ xml file to display a Javascript “class” (prototype functions) hierarchy as nodes and have (preferably) the public methods nested underneath and the private methods also displayed in the tree</p>
<p dir="auto">The objective is to have it recognize a coding convention that looks like:</p>
<pre><code> function TypeMyClass ()
 {
    Private properties
    var a;
    var b;

    //Public properties
    this.c;
    this.d;

    //Private methods
    var Init = function ()
    {
     //... Do something ...
    }

    //Public methods
    this.GetVarA = function ()
    {
      return a;
    }

    //Initialization
    Init ();
 }
</code></pre>
<p dir="auto">This is what I have so far, but I am getting nothing:</p>
<pre><code>&lt;parser 
id="js_function" 
displayName="Javascript" 
commentExpr="((/\*.*?\*)/|(//.*?$))"
&gt;     &lt;!--parser: sniff comment lines; either /*blah*/ or // blah --&gt;
&lt;classRange
    mainExpr="^[\s]*function([\s]+[_A-Za-z]?[\w_]*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{" 
    openSymbole = "\{"
    closeSymbole = "\}"
    displayMode = "node"
    &gt; 
    &lt;className&gt;
        &lt;nameExpr expr="[_A-Za-z]?[\w_]*[\s]*\("/&gt;    &lt;!--Narrow down from mainExpr towards the class names--&gt;
        &lt;nameExpr expr="[_A-Za-z]?[\w_]"/&gt;            &lt;!--Narrow down to the name itself --&gt;
    &lt;/className&gt;
    &lt;function
        mainExpr="(var/let|(this+[.]))+[\s]*[_A-Za-z][\w_]*[\s]*[=]+[\s]*[_A-Za-z][\w_]*[\s]*\("
        displayMode="$functionName"&gt;                  &lt;!--function: is used to find the method definitions --&gt;
        &lt;functionName&gt;
            &lt;nameExpr expr="[_A-Za-z][\w_]*[\s]*[=]+[\s]*[_A-Za-z]?[\w_]*[\s]*\("/&gt; &lt;!--Narrow down the mainExpr--&gt;
            &lt;nameExpr expr="[_A-Za-z][\w_]*[\s]*[=]"/&gt;                              &lt;!--Narrow further down to the name itself --&gt;
        &lt;/functionName&gt;
    &lt;/function&gt;
&lt;/classRange&gt;
&lt;/parser&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/14864/regex-help-needed-editing-the-function-list-xml-file</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 00:22:24 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14864.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 Dec 2017 22:22:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex help needed editing the function list xml file on Fri, 19 Jan 2018 21:36:19 GMT]]></title><description><![CDATA[<p dir="auto">@Florent-Pagès as available in Notepad++ v7.3.2.0 which was enhanced in v7.5.1.0 i.e. allowing <code>$</code> in identifiers and whitespace before the left/open parenthesis.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29592</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29592</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Fri, 19 Jan 2018 21:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to Regex help needed editing the function list xml file on Fri, 19 Jan 2018 19:52:47 GMT]]></title><description><![CDATA[<p dir="auto">try this one</p>
<pre><code>		&lt;!-- ========================================================= [ JS FPS ] --&gt;			
		
		&lt;parser 
		  displayName="Javascript" 
		  id="js_function" 
		  commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
		&gt;
		
			&lt;function

				mainExpr="((^|\s+|[;\}\.])([A-Za-z_]\w*\.)*[A-Za-z_]\w*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_]?\w*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{"
			&gt;
				&lt;functionName&gt;


					&lt;nameExpr expr="[A-Za-z_]\w*\s*[=:]|[A-Za-z_]?\w*\s*\(" /&gt;
					&lt;nameExpr expr="[A-Za-z_]?\w*" /&gt;
				&lt;/functionName&gt;



				&lt;className&gt;
					&lt;nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*\." /&gt;
					&lt;nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*" /&gt;
				&lt;/className&gt;
			&lt;/function&gt;
			
		&lt;/parser&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/29589</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29589</guid><dc:creator><![CDATA[Acdc95731]]></dc:creator><pubDate>Fri, 19 Jan 2018 19:52:47 GMT</pubDate></item></channel></rss>