But I would like to change it so that it grabs only the tiddlers that star with currentTiddler followed immediately by a comma. But not the others that have the currentTiddler but no comma immediately following.
Currently, until we have prametrized transclusions, I’d say you need to use a macro to concatename current with a comma and refer to it, something like
The logic behind removing the prefix if it exists, is that you can then check if the remaining text has a prefix of the comma character. The entire run starting with :filter is like a sieve that only lets through the titles that meet those criteria.
removeprefix<..currentTiddler> also only operates on and if, the tiddler has the prefix “current tiddler” thus also performing the initial filtering, that a simple prefix would also do.
I am stating, in part, how the remove prefix removeprefix<..currentTiddler> also only acts on tiddlers beginning with “current Tiddler”, which is what @DaveGifford was trying to understand, he thought the “prefix” operator was appropriate.
That is there are cases such as removeprefix `which are a filter and an action.
I wanted your view / confirmation since this is occurring inside the “:filter” run.
Here’s a more verbose description of what Saq’s filter syntax is doing:
Outside of the :filter[...] syntax, <currentTiddler> refers to the tiddler containing the <<tabs>> macro.
However, within the :filter[...] syntax, <currentTiddler> refers to each of the tiddlers found by the preceding filter run (i.e.,[!is[system]).
To refer to the original tiddler containing the <<tabs>> macro from within the :filter[...] syntax, we need to use the special filter variable, <..currentTiddler>.
Thus, within the :filter[...] syntax, using removeprefix<..currentTiddler> identifies titles matched by [!is[system] that start with the original tiddler title, and also removes that leading title text, so that the subsequent [prefix[,]] syntax can check to see if the rest of the matched title starts with a comma.
The result of processing the :filter[...] run is that only tiddlers that match [!is[system] and also start with the title of the containing tiddler followed by a comma are retained for processing by the remainder of the filter runs (i.e., :and[sort[caption]] -[<currentTiddler>]). Q.E.D