1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-30 09:13:16 +00:00

Update regexp filter docs with square brackets example

This commit is contained in:
Jermolene 2014-09-10 18:25:38 +01:00
parent 5d0c32b454
commit 6a952387d2

View File

@ -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<myfilter>]">
<div>
<$view field="title"/>
</div>
</$list>
</$set>
```