Jeremy

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?

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 <swwh...@verizon.net <javascript:>> 
> 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:jeremy...@gmail.com <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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to