Newbie question on split and regexp

65 views
Skip to first unread message

Guido B

unread,
Jun 18, 2020, 4:33:41 AM6/18/20
to TiddlyWiki
Hi

I'm still new to TW and I continue to struggle with the filter syntax. Here is what I try to achieve: 

  • I use TW to jot down notes during conversations
  • I use a custom field ("kontakt") to record who has attended a meeting
  • For that purpose I use an abbreviation of the persons names, eg. "SSC, DKR, HMF" ( a comma-delimited list)
  • For each person I have a tiddler with the full name of the person as its title
  • The abbreviated name is in a custom field named "kuerzel"
  • I would now like to append to each note a list of the attendees
What I was able to do was to use the following to list the attendee when only one person attended:

Code hier eingeben...
<$set name=kurzzeichen value= {{!!kontakt}}>

<<list-links filter:"[regexp:kuerzel<kurzzeichen>sort[title]]">>

</$set>


How can I generalized this when more than one person attended? I know that I have to somehow split the field "kontakt" into its parts (something like [[<kurzzeichen>]split[, ]]) and than to use the items of this newly created array to do the regexp-stuff. To be honest, I have, even after studying the various explanations and examples and googleing for hours, not the slightest idea of how to achieve this. So any hints would very much be appreciated!

Thanks, Guido

Guido B

unread,
Jun 18, 2020, 7:40:38 AM6/18/20
to TiddlyWiki
OK, I finally found the solution myself:

<$set name=contact value={{!!kontakt}}>

<$list filter="[<contact>splitregexp[, ]]" variable="item">

<<list-links filter:"[regexp:kuerzel<item>sort[title]]">>

</$list>

</$set>

TW Tones

unread,
Jun 18, 2020, 6:56:47 PM6/18/20
to TiddlyWiki
Guido

Thanks for sharing back to the community. SOmeone may get value from this with a search.

Regards
TW Tones
Reply all
Reply to author
Forward
0 new messages