Ciao Mark S.
"splitregexp" seems to be behaving here like "return match, throw the rest
away"
Yes?
Equivalent to ...
match: ^(.*?).$
replace: $1
The lazy match, **?*, insists that the last character of the line is thrown
away. Which is what was wanted?
TT
On Tuesday, 20 August 2019 00:52:32 UTC+2, Mark S. wrote:
>
> Hi Mohammad,
>
> Well, that won't do what MA wants. Your code would try to split the
> tiddler *name*, $:/plugins/felixhayashi/tiddlymap/graph/views/map, but MA
> wants the tiddler *contents *truncated by one.
>
> On Monday, August 19, 2019 at 3:13:58 PM UTC-7, Mohammad wrote:
>>
>> Mark, I mean just use <variable>, See the below revised code
>>
>>
>> \define ViewTiddlerAppended()
>> <$set name=shortpath filter="[<viewpath>splitregexp[^(.*?).$]]" select=1
>> >
>> <<shortpath>>. Nice to see you.
>> </$set>
>> \end
>>
>> <$vars viewpath="$:/plugins/felixhayashi/tiddlymap/graph/views/map" >
>>
>> <<ViewTiddlerAppended>>
>>
>> </$vars>
>>
>>
>>
>> On Monday, August 19, 2019 at 6:23:28 PM UTC+4:30, Mark S. wrote:
>>>
>>> Statements like
>>>
>>> {{<<variable>>}}
>>>
>>> don't work, so I assume that the filter equivalent, {<variable>} also
>>> doesn't work.
>>>
>>> When I test this latter form, it doesn't work.
>>>
>>> The $(...)$ substitution approach almost always does what I originally
>>> intended, so I tend to stick to it, perhaps more than I need to.
>>>
>>> Thanks!
>>>
>>> On Sunday, August 18, 2019 at 11:09:45 PM UTC-7, Mohammad wrote:
>>>>
>>>> To Josiah,
>>>>
>>>> This is an example of using regexp in Tiddlywiki worth to be included
>>>> in your regexp tutorial!
>>>>
>>>> @Mark
>>>> Why not just using <viewpath> instead of {$(viewpath)$}
>>>>
>>>> --Mohammad
>>>>
>>>> On Monday, August 19, 2019 at 1:59:13 AM UTC+4:30, Mark S. wrote:
>>>>>
>>>>> This variant uses the new splitregexp operator to eliminate the last
>>>>> character:
>>>>>
>>>>> \define ViewTiddlerAppended()
>>>>> <$set name=shortpath filter="[{$(viewpath)$}splitregexp[^(.*?).$]]"
>>>>> select=1 >
>>>>> <<shortpath>>. Nice to see you.
>>>>> </$set>
>>>>> \end
>>>>>
>>>>> <$vars viewpath="$:/plugins/felixhayashi/tiddlymap/graph/views/map" >
>>>>>
>>>>> <<ViewTiddlerAppended>>
>>>>>
>>>>> </$vars>
>>>>>
>>>>>
>>>>>
>>>>> On Sunday, August 18, 2019 at 11:49:19 AM UTC-7, MagoArcade wrote:
>>>>>>
>>>>>> Let's say "$:/plugins/felixhayashi/tiddlymap/graph/views/map"
>>>>>> contains the text "{line 1} Hello World}" (note the curly bracket)
>>>>>>
>>>>>>
>>>>>> \define ViewPath()
>>>>>> $:/plugins/felixhayashi/tiddlymap/graph/views/map
>>>>>> \end
>>>>>>
>>>>>>
>>>>>> \define ViewTiddlerAppended()
>>>>>> {{$(ViewPath)$}}. Nice to see you.
>>>>>> \end
>>>>>>
>>>>>> How do I get <<ViewTiddlerAppended>> to read:
>>>>>>
>>>>>> "{line 1} Hello World. Nice to see you."
>>>>>>
>>>>>> (i.e. remove the last character of the text in the tiddler)
>>>>>>
>>>>>
--
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/d92d9865-29a0-479a-9bfe-6b0e49c8a633%40googlegroups.com.