Subtiddlers in Node Explorer and Regexp Special Characters

In Mehregan edition from kookma, there is a filter to return subtiddlers (eg tiddler/child or tiddler:child) in the node explorer appears at the bottom of tiddlers (smart tabs).

\function subtiddler__pattern() "(^" =[<currentTiddler>escaperegexp[]] "\s*/|^" =[<currentTiddler>escaperegexp[]] "\s*:)" +[join[]]



<$list filter="[all[tiddlers]regexp<subtiddler__pattern>]">

</$list>

The function creates the input to regexp. I feel the whole solution hrad to follow and maintain. Can you propose a simpler solution?

To support answering this Question; the current pattern in the above example is (^New Tiddler\s*/|^New Tiddler\s*:)

  • Where the current tiddler is New Tiddler

However your question is very context specific, and does not really tell use what the question is or what the background is. For example what kind of input needs escaping?