This version will return  sub-groups for non-global searches. So in 
codacoder's example, this search:

<$list filter='[tag[TestGroups]get[text]regexps[(?g)bk-ann 
".+"]regexps[bk-ann "(.+)"]]'  >

will change this:


<<bk-ann "Explain the use of the Tiddlywiki's macro system">>X
>
> and
>
>                       <<bk-ann "Explain the scope rules of Tiddlywiki 
> macros">>
>
>
Into


Explain the use of the Tiddlywiki's macro system
> Explain the scope rules of Tiddlywiki macros


Notice that it takes 2 regexps filters to accomplish this (the first global 
one finds the items, the second trims them).

For counts, you can just use the count[] filter after the regexps filter 
you want.

Backup before trying.

Good luck!
Mark

On Friday, August 25, 2017 at 2:17:58 AM UTC-7, @TiddlyTweeter wrote:
>
> Ciao Mark S.
>
> Many thanks. I'll test it out and get back to you...
>
> Mark S. wrote:
>>
>> Another version of regexps to play with. This version will pull out all 
>> matches at once when the global flag is used. So the filter could look like:
>>
>> "[<currentTiddler>get[text]regexps[(?g)#\w+\b]tolower[]]"
>>
>  
>
>> Regular expressions in javascript can return sub-groups for non-global 
>> expression searches. It might be possible to implement this in regexps, if 
>> someone can think of a good use-case. 
>>
>
> I definitely could use that. Let me go *look at what I'm currently 
> working on and find a real use case*. Sub-groups allow a lot of things, 
> like (1) moving bits of the matched string around; (2) discarding bits of 
> it you don't need; (3) duplicating a sub-group, say as a heading.
>
> Plus. With what you have developed so far *is it possible to return a 
> MATCH COUNT*? If that were possible I have definite use cases I can lay 
> out.
>
> This is exciting. 
>
> Best wishes
> Josiah
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/96a03597-8182-4004-853e-ead183881da9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__core_modules_filters_regexps.js(2).json
Description: application/json

Reply via email to