The comma is part of the search-replace filter operator syntax

https://tiddlywiki.com/#search-replace%20Operator

-hw

On Wednesday, March 3, 2021 at 12:31:26 AM UTC+1 Hylke W. van Dijk wrote:

>
> Spot on!
>
> The triple quotes, which I came across, but did not understand. And which 
> I did not try before.
>
> -hw
>
>
> On Wednesday, March 3, 2021 at 12:27:24 AM UTC+1 Hylke W. van Dijk wrote:
>
>> Thanks Mat,
>>
>> ad 1
>> Escaping the regexp might be a solution. But how? I mean in a regular 
>> expression [a-z] is different from \[a-z\].
>> Unsure how to escape the regular expression. It might be a greediness / 
>> look-ahead problem.
>>
>> ad 2
>> No luck here, tried it. If I remember correctly <<__x__>> sort of casts 
>> the variable into a tiddly. That might be part of the explanation.
>>
>> ad 3
>> Sorry, typo in this mail.
>>
>> Cheers,
>> Hylke
>>
>>
>>
>>
>>
>>
>> On Tuesday, March 2, 2021 at 11:58:52 PM UTC+1 Mat wrote:
>>
>>> WOW! To say the least. (And incidentally I'm working on a distantly 
>>> related thing).
>>>
>>> Regarding your problems here are some first guesses:
>>>
>>> >regexp="([A-Z]+(?=[0-9]+))|([0-9]+(?=[A-Z]+))" 
>>> >and filter="[<ref>splitregexp<regexp>reverse[]]"
>>>
>>> Maybe you need to escape the square brackets?
>>>
>>> ><<mymacro one/2/three>> fails. I
>>>
>>> See if enclosing the argument with "..." helps
>>>
>>> ><$set filter:"filter" variable="var"> and <$vars var={{{ filter }}}> 
>>> give dif
>>>
>>> Again some syntactic tidbits (but maybe you just mistyped in this post):
>>>
>>> <$set filter*=*"filter" name="var">
>>>
>>>
>>> <:-)
>>>
>>>
>>>
>>> On Tuesday, March 2, 2021 at 10:18:33 PM UTC+1 [email protected] wrote:
>>>
>>>> Good day,
>>>>
>>>> Triggered by the announcement of Tamasha I decided to dig into TW5 some 
>>>> more. Therefore I created a --javascript free -- plugin for easy import 
>>>> and 
>>>> display of spreadsheet data, or more generally dataframes. Along the way I 
>>>> ran into some subtleties / miscomprehensions of the tiddlywiki framework , 
>>>> which might be of interest to others. A demonstration of the dataframe 
>>>> plugin and  a working description of three subtleties in action is 
>>>> available at: https://hwvandijk.bitbucket.io/tw-dataframe/
>>>>
>>>> 1. splitregexp that crashes the Javascript engine of Firefox 58, but 
>>>> works on tiddlydesktop 0.14 (chromedriver 81)
>>>> I used a (elaborate) regular expression in splitregexp to split 
>>>> "ABC123" in to "123 ABC" in one go. 
>>>> i.e.
>>>> regexp="([A-Z]+(?=[0-9]+))|([0-9]+(?=[A-Z]+))"  
>>>> and filter="[<ref>splitregexp<regexp>reverse[]]"
>>>>
>>>> I get a Javascript error: *uncaught exception: Linked List only 
>>>> accepts string values, not undefined *
>>>> The problem has been solved by using a more straightforward regular 
>>>> expression in a  search-replace:regexp filter operator.
>>>>
>>>> 2. $x$ and <<__x__>> or similar but not identical
>>>> I had problems using macro parameters in filters. Therefor I cast them 
>>>> in a <$set> or <$vars> variable, either through $x$ or <<__x__>>. The 
>>>> former works fine unless a parameter x that is passed to the macro 
>>>> contains 
>>>> slashes.
>>>> <<mymacro one.2.three> works fine, <<mymacro one/2/three>> fails. It 
>>>> renders the <$vars expression> literally in the page.
>>>>
>>>> 3. <$set filter:"filter" variable="var"> and <$vars var={{{ filter }}}> 
>>>> give different results
>>>> To specify the index/columns of the dataframe  to be displayed I use a 
>>>> list of ranges. Meaning that a spec of "1,3-5,7" should be transformed 
>>>> into 
>>>> "1,1 3,5 7,7" such that when you feed these entries one by one into the 
>>>> range operator you get [1 2 3 4 5 7]. 
>>>> However with:
>>>>
>>>> <$vars p=<<__param__>> 
>>>>       regexp="^(\d+)$" > 
>>>> <$set name="setref" 
>>>> filter="[<p>split[,]search-replace:g:regexp<regexp>,[$1,$1]]" >
>>>> <$vars varsref={{{ [<p>split[,]search-replace:g:regexp<regexp>,[$1,$1]] 
>>>> }}} >
>>>>
>>>> The variables *setref* and *varsref* are not identical. *varsref* is 
>>>> wrong, you should use *setref*.
>>>> varsref only works for simple specifications, such as "7". It looks 
>>>> like *varsref *does not obey the g (global) specifier.
>>>>  
>>>> Sorry for the long mail, but hopefully someone can point out my 
>>>> misconceptions or file a bug if that is appropriate.
>>>>
>>>> Cheers,
>>>>
>>>> Hylke van Dijk
>>>>
>>>>
>>>>
>>>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f29ae3e3-28a7-4d27-90f6-887e5c4c3940n%40googlegroups.com.

Reply via email to