From 6a952387d26158ad3c22252cb04697be817ffeaf Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 10 Sep 2014 18:25:38 +0100 Subject: [PATCH] Update regexp filter docs with square brackets example --- .../tiddlers/filters/FilterOperator regexp.tid | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid b/editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid index 9c5c55786..5fa760db3 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid @@ -19,3 +19,18 @@ For example: |`[all[tiddlers]regexp[eggcup(?i)]]` |Selects all tiddlers that have the string "eggcup" in their title (ignoring case) | |`[all[tiddlers]regexp[(?i)\.jpe?g$]]` |Selects all tiddlers with titles ending in ".jpg" or ".jpeg" (ignoring case) | |`[all[tiddlers]regexp:modified[^2014]]` |Selects all tiddlers whose modified field starts with the string "2014" | + +! Regular Expressions with Square Brackets + +Note that the filter syntax doesn't allow you to directly enter regular expressions that include square brackets. Instead, you should use a variable to store the filter string. For example, the following regular expression matches all titles that contain any combination the letters "a", "b" and "c" (with no other characters present). + +``` +<$set name="myfilter" value="^[abc]*$"> +<$list filter="[regexp:title]"> +
+<$view field="title"/> +
+ + +``` +