From 318fe3c04655756c55ec7268f87664cc568e4677 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 3 Apr 2019 19:49:38 +0200 Subject: [PATCH] docs/string: Replace doesn't do globs As a bit of weirdness in string's design, replace does literal matching (`*` aren't expanded) by default, not globs. [ci skip] --- sphinx_doc_src/cmds/string.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_doc_src/cmds/string.rst b/sphinx_doc_src/cmds/string.rst index 13e3608b6..220247026 100644 --- a/sphinx_doc_src/cmds/string.rst +++ b/sphinx_doc_src/cmds/string.rst @@ -235,7 +235,7 @@ If you are familiar with these, it is useful to know how ``string`` differs from In contrast to these classics, ``string`` reads input either from stdin or as arguments. ``string`` also does not deal with files, so it requires redirections to be used with them. -In contrast to ``grep``, ``string``\ s `match` and `replace` default to glob-mode. If set to regex-mode, they use PCRE regular expressions, which is comparable to ``grep``\ s `-P` option. `match` defaults to printing just the match, which is like ``grep`` with `-o` (use `--entire` to enable grep-like behavior). +In contrast to ``grep``, ``string``\ s `match` defaults to glob-mode, whie `replace` defaults to literal matching. If set to regex-mode, they use PCRE regular expressions, which is comparable to ``grep``\ s `-P` option. `match` defaults to printing just the match, which is like ``grep`` with `-o` (use `--entire` to enable grep-like behavior). Like ``sed``\ s `s/` command, ``string replace`` still prints strings that don't match. ``sed``\ s `-n` in combination with a `/p` modifier or command is like ``string replace -f``.