Does the regex filter return anything?

On Thursday, 28 March 2019 17:02:53 UTC+1, S. S. wrote:
>
> I am trying to find out which of 3 separators ( *-* or */* or *.* ) is 
> being used in a string.
>
> The result of the below gives the title that matches.
> 1= <$list filter="[[12.34]] +[regexp[(-|/|\.)]]"></$list>
>
> 2= <$list filter="[[23-45]] +[regexp[(-|/|\.)]]"></$list>
>
> 3= <$list filter="[[34/56]] +[regexp[(-|/|\.)]]"></$list>th
>
> Result:
> 1= 12.34
>
> 2= 23-45
>
> 3= 34/56
>
> This is the way I am checking to see which separator is returned. I am not 
> satisfied with this cumbersome method, even though it works.
> <$list filter="[[12.34]] [[23-45]] [[34/56]]">
>
> <$list filter="[<currentTiddler>] +[regexp[(\.)]]"><<currentTiddler>> = 
> .</$list>
> <$list filter="[<currentTiddler>] +[regexp[(-)]]"><<currentTiddler>> = 
> -</$list>
> <$list filter="[<currentTiddler>] +[regexp[(/)]]"><<currentTiddler>> = 
> /</$list>
> </$list>
>
> Result:
> 12.34 = .
>
> 23-45 = -
>
> 34/56 = / 
>
> I want the result of my first $list to be the character that matched the 
> regex.
> I was wondering if there is a way to construct the regex so that the 
> *regexp* operator shows exactly what matched, rather than just returning 
> the input title?
>
> Thanks
>

-- 
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/ce5b0084-55d2-46b2-a1f1-40a74eda8bde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to