mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-28 22:08:12 +09:00
command: Fix replace to be able to insert '$' (#2954)
* command: Fix replace to be able to insert '$' * help: commands: Precise the documentation of `replace` * help: commands: Further improvement suggested within the review Co-authored-by: Beni Cherniavsky-Paskin <cben@redhat.com> * Fix replace with '$' in a more kosher way On top of JoeKar's fix. --------- Co-authored-by: Beni Cherniavsky-Paskin <cben@redhat.com> Co-authored-by: Dmytro Maluka <dmitrymaluka@gmail.com>
This commit is contained in:
@@ -43,6 +43,12 @@ quotes here but these are not necessary when entering the command in micro.
|
||||
Note that `search` must be a valid regex (unless `-l` is passed). If one
|
||||
of the arguments does not have any spaces in it, you may omit the quotes.
|
||||
|
||||
In case the search is done non-literal (without `-l`), the 'value'
|
||||
is interpreted as a template:
|
||||
* `$3` or `${3}` substitutes the submatch of the 3rd (capturing group)
|
||||
* `$foo` or `${foo}` substitutes the submatch of the (?P<foo>named group)
|
||||
* You have to write `$$` to substitute a literal dollar.
|
||||
|
||||
* `replaceall 'search' 'value'`: this will replace all occurrences of `search`
|
||||
with `value` without user confirmation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user