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>
Result:
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