Search Operator in Tiddlywiki 5.2.1

I am experimenting with search operator in TW 5.2.1

Does regexp search mode really works like old regexp filter operator?

Q1. in https://tiddlywiki.com/ create a tiddler with below wikitext! These two returns different results?

\define rxp() ^[a-z]+$

<$list filter="[!is[system]search:title:regexp<rxp>limit[5]]">

</$list>

---

<$list filter="[!is[system]regexp:title<rxp>limit[5]]">

</$list>

Q2. Why search operator has a caseinsensitive search-mode with regexp? why not use (?i)?

I would appreciate to share your thoughts!

1 Like

Note this works fine:

<$list filter="[!is[system]search:title:casesensitive,regexp<rxp>limit[5]]">

</$list>

BUT then it is very confusing with pattern ^[a-z]+$.

The documentation is silent here!

@Mohammad

You need this for the first one:

<$list filter="[!is[system]search:title:regexp,casesensitive<rxp>limit[5]]">

</$list>

@CodaCoder
Why we need casesensitive when we use pattern like ^[a-z]+$? Don’t you think this confusing?

Perhaps, but the answer lies in the history of the search operator. Prior to 5.1.18, it was caseinsensitive only. When regex was added, it needed casesenstive support (which fits better with the regex support).

That’s my understanding, at least. Frankly, I’d move on – it’s not a bug.