The code in the PR I submitted does as you specify in your examples, except 
that in the last example returning the title if nothing is found would be a 
non-sequitur, and should probably be done through some other mechanism.

Jed's code is probably better and does more, but I've attached mine for 
what it's worth. Drag and drop into your tw, save, reload (back-up is good 
too). Remember to use regexps (with an "s" on the end) and not regexp.

-- Mark



On Monday, February 12, 2018 at 5:38:49 AM UTC-8, Stephan Hradek wrote:
>
>
>
> Am Montag, 12. Februar 2018 11:36:42 UTC+1 schrieb PMario:
>>
>>
>> There is a second PR: https://github.com/Jermolene/TiddlyWiki5/pull/2963 
>> which may be similar. ... +1 this one too!
>>
>> Especially that one looks pretty similar to my code, but seems to do 
> something differently.
>
> Haven't figured out how to completely see that code and include it in my 
> TW to try & test it.
>
> Example of how mine would work:
>
> Exampletiddler contains
> Auf der Mauer, auf der Lauer sitzt 'ne kleine Wanze
>
> First example regexp:
> <$list filter="[regexp:text[auf der (\w+)]]"/>
>
> will return "Lauer" - as "auf" doesn't match "Auf"
>
> Second example regexp:
> <$list filter="[regexp:text[(?i)auf der (\w+)]]"/>
>
> will return "Mauer" - as "auf" now matches "Auf" and we didn't use global 
> search
>
> Third example regexp:
> <$list filter="[regexp:text[(?gi)auf der (\w+)]]"/>
>
> will return "Mauer" and "Lauer" - as we did a case-insensitive global 
> search
>
> Last Example
> <$list filter="[regexp:text[(?i)auf der \w+]]"/>
>
> will return "Exampletiddler" - as we have no capturing group and so the 
> title is returned.
>
>
>
>
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dd126dd9-72af-44a7-bca0-87b3362f0989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__core_modules_filters_regexps.js.json
Description: application/json

Reply via email to