created: 20201118094513209 modified: 20201118103414384 tags: [[Operator Examples]] [[search-replace Operator]] [[sortsub Operator]] title: How to remove stop words type: text/vnd.tiddlywiki \define book-list() [[A Tale of Two Cities]] [[The Dice Man]] [[A New Kind of Science]] [[The Recursive Universe]] [[Great Expectations]] [[Animal Farm]] \end \define compare-without-stopwords() [search-replace:i:regexp[^The |A ],[]] \end You can use the [[search-replace Operator]] in combination with the [[sortsub Operator]] to ignore stop words like "A" and "The" at the beginning of titles when sorting. (Note for example that "A Tale of Two Cities" sorts under "T" rather than "A") <<.operator-example 6 "[enlistsortsub]">> You can also customise the listing so that "A Tale of Two Cities" is listed as "Tale of Two Cities, A" but still links to the correct tiddler. < <$list filter="[enlistsortsub]">
  • <$link><$text text={{{[search-replace:i:regexp[(^The |A )(.*)],[$2, $1]]}}}/>
  • """>>