Case-sensitive search

44 views
Skip to first unread message

Sven

unread,
Mar 15, 2017, 3:48:27 AM3/15/17
to TiddlyWiki
Hi everyone,
Is there an easy way to make the search case-sensitive?
http://tiddlywiki.com/#Searching%20in%20TiddlyWiki is not very explicit about it. I guess I could manage it with the application of filters but I was wondering whether there is an easier way, e.g. clicking a checkbox or so....
Thanks!

Eric Shulman

unread,
Mar 15, 2017, 4:30:25 AM3/15/17
to TiddlyWiki
On Wednesday, March 15, 2017 at 12:48:27 AM UTC-7, Sven wrote:
Is there an easy way to make the search case-sensitive?
http://tiddlywiki.com/#Searching%20in%20TiddlyWiki is not very explicit about it. I guess I could manage it with the application of filters but I was wondering whether there is an easier way, e.g. clicking a checkbox or so....

The default core definitions for the search interface use a [search{...}] filter to find the matches to your input.  This filter is, by design, case insensitive.

However, if you replace the [search{...}] filter with a [regexp{...}] filter, then it will perform a case-sensitive search by default... and, using [regexp{...}], you can search for *text patterns* rather than just literal text strings.

To change the TW core defaults, you can edit the following two shadow tiddlers:

   $:/core/ui/SideBarLists
      replace "search{$(searchTiddler)$}" with "regexp{$(searchTiddler)$}"

   $:/core/ui/DefaultSearchResultList
      replace "search{$(searchTiddler)$}" with "regexp{$(searchTiddler)$}"
      AND
      replace "search:title{$(searchTiddler)$}" with "regexp:title{$(searchTiddler)$}"

That should do it.

enjoy,
-e
Eric Shulman
TiddlyTools: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals

Sven

unread,
Mar 15, 2017, 5:34:23 AM3/15/17
to TiddlyWiki
Thanks Eric, that worked fine. :)

Reply all
Reply to author
Forward
0 new messages