Yes, I know, titles are a form of filter. But, I need to programmatically be able to discern if a field value is a filter or a title/titles.
Currently I’m peeking at the initial characters of the string - if it is prefixed with a single [ then it’s interpreted as a filter. If it is prefixed with [[ or no bracket, then it is/are title/s. That strategy is not sure-fire; a title can, hypthetically, include a string prefixed with [ and a filter needs more stuff than just a [[ prefix. But the context for this all is pretty forgiving and things happen “out in the open” as one types the string, so it is pretty obvious if something goes wrong.
So I’m wondering if there is a better - yet still simple - method to discern if a string is a filter or not. For example, there may be some nifty regexp for it? Some hidden core function? Or just some tiddlenious method…
One Approach I use, it to alter my macros to treat the parameter as a filter, which will be treated as a list of titles if it is. Because often a list of titles is just a simplified filter any way.
Right that is pretty much the algo I used too but which I think is too brittle. I don’t think it is enough to look at “bracket prefix configurations” to make the distinction, for example [[foo]prefix[f]] is arguably a filter.
This is why my preferred approach is to treat*** titles, title lists and filters*** all as filters, if there is any chance the parameter value is any of these.