mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-05 17:46:19 +00:00
Update regexp filter docs with square brackets example
This commit is contained in:
parent
5d0c32b454
commit
6a952387d2
@ -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>
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user