[TW5] Find exact match

207 views
Skip to first unread message

Jon

unread,
Apr 3, 2015, 3:16:18 PM4/3/15
to tiddl...@googlegroups.com
Hi,

I want to search for an exact text match (eg "Unique text"). I've come across this [!is[system]regexp:text[Unique text]] but it doesn't quite work.

For instance it will also find "que text".

What would do the job?

Thanks
Jon


PMario

unread,
Apr 3, 2015, 5:45:21 PM4/3/15
to tiddl...@googlegroups.com
Can you confirm this behaviour for tiddlywiki.com

I tested this at tiddlywiki.com and it seems to work ok. Which TW <<version>> do you use?

{{{[!is[system]regexp:text[Unique text]]}}}

-mario

Jeremy Ruston

unread,
Apr 4, 2015, 3:39:43 AM4/4/15
to TiddlyWiki
Hi Jon

If you want to check for a precise match with the content of a field you can use the "field" filter operator:

[!is[system]text[Unique text]]

It's also possible to fix the regexp version by anchoring the text to the start and end of the text:

 [!is[system]regexp:text[^Unique text$]]

Best wishes

Jeremy.



--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1b0d1f86-0560-4bbb-b221-0d9e73f4d64b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Jon

unread,
Apr 4, 2015, 5:21:17 AM4/4/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi,

thanks for the replies, but I can't seem to get the desired results.

Using the Advanced search at Tiddlywiki.com and typing the following expressions into the box will produces these results:

[!is[system]regexp:text[feel chained]] will match to tiddler "HelloThere"

but so will

[!is[system]regexp:text[chained]]

Whereas

[!is[system]regexp:text[^feel chained$]] produces 0 match

[!is[system]text[feel chained]] produces 0 match

and

[!is[system]regexp:text[^$]] produces the following matches


I must be doing something wrong, but can't quite see what.

Thanks
Jon

Jeremy Ruston

unread,
Apr 4, 2015, 5:27:26 AM4/4/15
to Jon, TiddlyWiki
Hi Jon

I'm afraid I misunderstood. I thought you were trying to match tiddlers whose entire body text was an exact match.

If you're trying to perform an exact match of a substring then I'd expect this to work:

[!is[system]regexp:text[feel chained]]

It's not a great solution, because regexp special characters will be treated differently - for example, matching a period will actually match any character, not just a period.

Best wishes

Jeremy.


On Sat, Apr 4, 2015 at 10:21 AM, Jon <five...@gmail.com> wrote:
Hi,

thanks for the replies, but I can't seem to get the desired results.

Using the Advanced search at Tiddlywiki.com and typing the following into the box will produce the following:

Jon

unread,
Apr 4, 2015, 5:52:22 AM4/4/15
to tiddl...@googlegroups.com, five...@gmail.com, jeremy...@gmail.com

Hi Jeremy,

I should have explained what I'm trying to do.

I want to filter a number of tiddlers so I can apply tags to them as a batch.

Each of the tiddlers contains a line of text which I can use as an exact match

The problem with

[!is[system]regexp:text[feel chained]]

is that it will also match

[!is[system]regexp:text[chained]]

and so will also match to a tiddler with "chained" in the text (as well as "feel chained")

and so applying the filter to my case would include additional results which I don't want to tag.

Regards

Jon

unread,
Apr 4, 2015, 6:22:55 AM4/4/15
to tiddl...@googlegroups.com, five...@gmail.com, jeremy...@gmail.com
Sorry, I've just realised my stupidity!

[!is[system]regexp:text[feel chained]]

does exactly what it says on the tin!

Thanks
Jon
Reply all
Reply to author
Forward
0 new messages