Jeremy
The searchbox code apparently stores the search string in $:/temp/search.
I figured out the first part of my question, how to use the string entered
from a search box as the search string.
<$set name="search-string" value={{$:/temp/search}}>
I would like to be able to use define the value of $:/temp/search with
$set. Maybe something like:
<$set name="$:/temp/search" value="x">?
Thanks
Steve Wharton
On Thursday, November 27, 2014 9:49:03 AM UTC-5, Jeremy Ruston wrote:
>
> Hi Steve
>
> In your example, instead of using search-string as the variable name what
>> if I wanted to set and use the variable name $:/temp/search?
>>
>
> I'm not sure I understand $:/temp/search is a tiddler title, not a
> variable name. Are you asking if the search term could be stored in a
> tiddler instead of a variable?
>
> Best wishes
>
> Jeremy
>
>
>
>
>>
>> Thanks for your help.
>> Steve Wharton
>>
>>
>> On Thursday, November 27, 2014 8:43:46 AM UTC-5, Jeremy Ruston wrote:
>>>
>>> Hi Steve
>>>
>>> You can only use transclusion within filters to transclude an entire
>>> operand. With the syntax you've used the curly braces would be considered
>>> part of the regexp.
>>>
>>> So you can do something like this:
>>>
>>> <$list filter="[!is[system]tags[]regexp{$:/temp/search}]">
>>>
>>> You can also use variables:
>>>
>>> \define search-string()
>>> (?i)($(search-term)$)
>>> \end
>>>
>>> <$set name="search-term" value="searchme">
>>> <$list filter="[!is[system]tags[]regexp<search-string>]"/>
>>> </$set>
>>>
>>> However, not that the search term doesn't get "regexp encoded" so any
>>> special regexp characters will not be searched for literally.
>>>
>>> Best wishes
>>>
>>> Jeremy
>>>
>>>
>>>
>>> On Thu, Nov 27, 2014 at 1:13 PM, steve <[email protected]> wrote:
>>>
>>>> Hi
>>>>
>>>> Is there a way to generalize regexp to use a variable?
>>>>
>>>> I'm trying to modify SearchBox (from http://tesis.tiddlyspot.com/) to
>>>> use regular expressions.
>>>>
>>>> I've succeeded in hardcoding a regular expression to find tags that
>>>> contain the string "xyz"
>>>> <$list filter="[!is[system]tags[]regexp[(?i)^.+(xyz).+$]]">
>>>>
>>>> The SearchBox code has an example of finding tags that match a prefix
>>>> using a variable
>>>> <$list filter="[!is[system]tags[]prefix{$:/temp/search}]">
>>>>
>>>> Using the Searchbox prefix search as an example, I tried replacing xyz
>>>> with
>>>> {$:/temp/search} as in
>>>>
>>>> <$list filter="[!is[system]tags[]regexp[(?i)^.+({$:/temp/
>>>> search}).+$]]">
>>>>
>>>> but it doesn't work.
>>>>
>>>> Steve Wharton
>>>>
>>>>
>>>> On Wednesday, November 26, 2014 8:39:04 AM UTC-5, steve wrote:
>>>>>
>>>>> Tobias
>>>>>
>>>>> I agree. The one other thing that I might wish for would be to show a
>>>>> second list of tags that contain, but do not start with the search string.
>>>>>
>>>>> Steve Wharton
>>>>>
>>>>> On Tuesday, November 25, 2014 8:36:42 PM UTC-5, Tobias Beer wrote:
>>>>>>
>>>>>> Hi Steve,
>>>>>>
>>>>>>
>>>>>>> The SearchBox at http://tesis.tiddlyspot.com/ was just what I was
>>>>>>> looking for. Thanks to Alberto Molina!
>>>>>>>
>>>>>>
>>>>>> Actually, besides the fact that I don't like how *tags are hidden*
>>>>>> under more,
>>>>>> to show the *tags first* in the search results makes total sense.
>>>>>>
>>>>>> Best wishes, Tobias.
>>>>>>
>>>>>
>>>
>>>
>>> --
>>> Jeremy Ruston
>>> mailto:[email protected]
>>>
>>
>>
>
>
> --
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>
--
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.