]> git.lizzy.rs Git - micro.git/commitdiff
Support regex capture groups in replace command
authorZachary Yedidia <zyedidia@gmail.com>
Thu, 13 Feb 2020 21:05:56 +0000 (16:05 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Thu, 13 Feb 2020 21:05:56 +0000 (16:05 -0500)
See https://golang.org/pkg/regexp/syntax/ for the
supported syntax. Here are some examples:

```
replace "(foo)" "$1-bar"
replace "(foo)" "${1}-bar"
replace "(?P<group>foo)" "$group-bar"
replace "(?P<group>foo)" "$group-bar"
replace "(?P<key>\w+):\s+(?P<value>\w+)$" "$key=$value"
```

Closes #1115


No differences found