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"/> +
+ + +``` +