mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
docs/string: Add a --
example to the match section
This keeps tripping people up. We can't mention it *everywhere*, but lets see if it works just in "match", since that sees to be where people hit it most.
This commit is contained in:
parent
15939be56c
commit
9e1c8a70bf
1 changed files with 12 additions and 0 deletions
|
@ -59,6 +59,12 @@ Match Glob Examples
|
|||
>_ string match -i 'a??B' Axxb
|
||||
Axxb
|
||||
|
||||
>_ string match -- '-*' -h foo --version bar
|
||||
# To match things that look like options, we need a `--`
|
||||
# to tell string its options end there.
|
||||
-h
|
||||
--version
|
||||
|
||||
>_ echo 'ok?' | string match '*\?'
|
||||
ok?
|
||||
|
||||
|
@ -91,6 +97,12 @@ Match Regex Examples
|
|||
cat4
|
||||
dog4
|
||||
|
||||
>_ string match -r -- '-.*' -h foo --version bar
|
||||
# To match things that look like options, we need a `--`
|
||||
# to tell string its options end there.
|
||||
-h
|
||||
--version
|
||||
|
||||
>_ string match -r '(\d\d?):(\d\d):(\d\d)' 2:34:56
|
||||
2:34:56
|
||||
2
|
||||
|
|
Loading…
Reference in a new issue