I wish I could put a regex in a filter, in order to select all fields whose 
identifiers begin with the same group of characters in tiddlers inheriting 
one of my templates.

The needed functionality is to loop through different fields with the same 
name except for a number at the end, outputting a phrase before the value 
of those fields only if that particular tiddler is present in the child 
tiddlers that will transclude the template. The intended purpose is to list 
people who are the subjects of photographs; each photograph tiddler has one 
or more "subject#" fields containing names. A portrait of John Smith has a 
field *subject 1: John Smith*, while an expedition photo of Lewis and Clark 
might have *subject1: Meriwether Lewis* and *subject2: William Clark*.

Three thoughts about how to do this:

   - A regex in a $list widget, if such a thing were possible: <$list 
   filter="[all[current]has[subject*[1-9]*]">
   - A *for* loop... I'm guessing this would require a macro? Would I 
   define the index variable using the *$set* widget?
   - The *$fields* widget allows me to approximate what I want to do due to 
   its useful *template* attribute, but it is difficult to foresee all the 
   many fields that need to be exlcuded using its *exclude* attribute.

I saw that there is an escaperegexp operator 
<https://tiddlywiki.com/#escaperegexp%20Operator>, but I'm guessing that 
this filter notation merely escapes regex strings?

I don't really understand; I'm not a developer myself, merely a user who 
has learned basic JavaScript syntax.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fa94d506-fc1c-4cd1-9f7d-5a9d5e17dec1%40googlegroups.com.

Reply via email to