List tiddlers that have a field value with certain suffix

55 views
Skip to first unread message

Mat

unread,
Apr 17, 2021, 4:26:04 AM4/17/21
to TiddlyWiki
I have a variable <<__chunk__>>  with e.g the value bar/ and need to find which tiddlers have a path field with where this value is a suffix. For example, I need to find the two tiddlers that have these respective path fields:

path: foo/bar/
path: frotz/bar/

It seems I must[1] use a regexp but I can't get this to work:

<$vars chunk="bar/">
<$vars reg="[<chunk>$]" >
<$list filter="""[all[tiddlers]regexp:path<reg>]""">
<$link/> {{!!path}}<br>
</$list>
</$vars>
</$vars>

(In actual use, the chunk variable is remote so it reads reg="[<__chunk__>$]" )

Is the regexp wrong? What to do? Better ideas?

Thank you!

<:-)

Note
[1] Using the filter operator for a subfilter does not work because the filter op has a bug, i.e this does not work:

<$vars subfilter="[get[path]suffix<__chunk__>]">
{{{ [all[tiddlers]has[path]filter<subfilter>] }}}
</$vars>

Saq Imtiaz

unread,
Apr 17, 2021, 4:35:04 AM4/17/21
to TiddlyWiki
Try this:

{{{ [has[path]] :filter[get[path]suffix<__chunk__>] }}}

Mat

unread,
Apr 17, 2021, 4:52:01 AM4/17/21
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages