Hello bege10,
To fully distinguish the different GOTO, CALL and START commands, of your batch file, I suppose that you need all the contents of the line, starting with these commands :-)
If so, here is, below, a batch parser, which should work nice !!
Open your active functionList.xml file
Change the present batch_label id parser contents by the parser, below :
<parser id=“batch_label” displayName=“BAT Label” commentExpr=“^[\t ](::|REM).?$”>
<function
mainExpr=“^[\t ]*\K.+?$”
displayMode=“$functionName”>
<functionName>
<nameExpr expr=“(call |goto |start |(?<=:)).+?$”/>
</functionName>
</function>
</parser>
Notes :
The commentExpr string is, either, the word REM or the symbol ::, preceded by possible leading space/tabulation characters and followed by any range, even null, or characters
Then, the mainExpr string, from which the different entities, to display in the FunctionList window, will be extracted, is any, non-null, range of characters, which follows possible leading space/tabulation characters ( and different from comment ranges ! )
Finally, the expr string is, either :
The word
call,
goto or
start, followed by a
space and any
non null range of characters
Any
non null range of characters, following a
colon (
: )
IMPORTANT :
The functionList regex engine does NOT act as the Notepad++ one. By default, it considers that the dot meta-character ( . ) match, absolutely, any character ( standard or EOL ones )
But, as the Notepad++ regex engine does, it considers that the ^ and $ assertions stand for the beginning and the end of any line
So, when you want to match, from any location, all the remaining characters of a line, TWO syntaxes are possible :
.+?$ which matches any non-null range of any character, ( standard or EOL ones ), till the nearest EOL location, due to the lazy quantifier +?
OR
(?-s).+ which matches any non-null range of standard characters only, due to the in-line modifier (?-s)
Of course, if the range of characters may be a zero-length string, prefer the syntax .*?$ OR (?-s).*
Best Regards,
guy038