50 ways and none works

I want to list the tiddlers that have the current tiddler’s title in their custom ‘formato’ field. None of these works. I am hoping that all the new stuff you guys added to TW the last time around will give me what I need???

<<list-searchtitulo "[!is[system]regexp:formato<currentTiddler>regexp<term>limit[2500]sort[orden]]" template="$:/.giffmex/listitemtemplate/titulo">>

<<list-searchtitulo "[!is[system]regexp:formato[<currentTiddler>]regexp<term>limit[2500]sort[orden]]" template="$:/.giffmex/listitemtemplate/titulo">>

<<list-searchtitulo "[!is[system]regexp:formato[{{!!title}}]regexp<term>limit[2500]sort[orden]]" template="$:/.giffmex/listitemtemplate/titulo">>

<<list-searchtitulo "[!is[system]regexp:formato{{!!title}}regexp<term>limit[2500]sort[orden]]" template="$:/.giffmex/listitemtemplate/titulo">>

Edit: Me thinks regexp was not the issue and so this post is kind of useless. I"m hoping my subsequent posts hit the target a wee touch closer…

I changed the content of tiddler “b” to the following, and this works like a charm:

\define list_em(this_filter)
<$list filter="[$this_filter$]">
<<currentTiddler>>; 
</$list>
\end

! I am tiddler b

{{{ [regexp:formato<currentTiddler>] }}}

<$macrocall $name="list_em" this_filter={{{ [[regexp:formato{]][<currentTiddler>] [[!!title}]] +[join[]] }}}/>

And since who really wants to use a macrocall widget every time…

Macros setup and put in a macros tiddler, so that tiddler “b” is nice and tidy:

Screenshot 2023-06-18 12.08.58 AM

Hmm. Maybe I should have named that macro “FormatoMeTiene”

Thanks, Charlie, I appreciate the time you took to answer.

But I am kind of already invested in @Mohammad 's KISS macro, and I was just hoping for the proper filter to use in that macro. There has to be a simple way of doing that.

What is in the formato field? Just titles or ??? Also, what is <term> ? With regexp, it’s sometimes necessary to construct a search variable that gets fed into the regular expression.

1 Like

I’m not familiar with Mohammad’s macro, but I suspect that the regexp operator may be causing the problem. If you’re just searching for a literal value—in this case, the current tiddler’s title—then I’d expect search:formato<currentTiddler> or search:formato{!!title} to work. If you’re searching in regexp mode, any symbols in your title that happen to have a regex meaning will be treated as syntactic modifiers, not as literal characters to be searched for.

Incidentally, you’ve got some extra bracket nesting in these three failed attempts:

In filter syntax, braces or brackets that would normally get doubled only need a single character—so `` regexp:formato{!!title} would be syntactically correct. Similarly, you can’t nest types of brackets like regexp[<currentTiddler>] or regexp[{!!title}]: square brackets signify a literal text value, so if the latter worked at all, it would be looking for “{!!title}” in your “formato” field.

2 Likes

Yes, this solved the problem. Thanks Etardiff!

1 Like

No worries, Dave.

I suggest you modify your OP with some context to indicate you specifically want to get KISS-related something working.

Thanks Charlie. The OP had four versions of the macro visible. I thought that would make it clear enough. Again, thanks for your help.

I thought that was a custom macro you created and did not provide. I had no idea where the macro came from. There was nothing in the OP saying it was a KISS macro by Mohammad.