mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 04:11:14 -03: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user