You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zk/tests/cmd-list-filter-match-re.tesh

30 lines
1.1 KiB
Plaintext

# Regular expression match strategy.
$ cd full-sample
# Long flag.
$ zk list -q --debug-style --match-strategy re --match 'न.*ते'
><title>Strings are a complicated data structure</title> <path>oumc.md</path> (just now)
>
> - Given the Hindi word "नमस्ते":
>
# Short flag.
$ zk list -q --debug-style -Mr --match 'न.*ते'
><title>Strings are a complicated data structure</title> <path>oumc.md</path> (just now)
>
> - Given the Hindi word "नमस्ते":
>
# multiple match flags.
$ zk list -q --debug-style -Mr --match "mut.*" --match "thr..d"
><title>Mutex</title> <path>inbox/er4k.md</path> (just now)
>
> - * Abbreviation of *mutual exclusion*.
> * An approach to manage safely shared state by allowing only a single thread to access a protected value at one time.
> * A mutex *guards* a protected data with a *locking system*.
> * Managing mutexes is tricky, using [channels](../fwsj) is an easier alternative.
> * The main risk is to create *deadlocks*.
> * Thanks to its [Ownership](../88el) pattern, Rust makes sure we can't mess up when using locks.
>