mirror of
https://github.com/danbulant/nushell
synced 2026-05-19 20:38:40 +00:00
745 B
745 B
| title | layout | version |
|---|---|---|
| str find-replace | command | 0.59.1 |
finds and replaces text
Signature
> str find-replace (find) (replace) ...rest --all
Parameters
find: the pattern to findreplace: the replacement pattern...rest: optionally find and replace text by column paths--all: replace all occurrences of find string
Examples
Find and replace contents with capture group
> 'my_library.rb' | str find-replace '(.+).rb' '$1.nu'
Find and replace all occurrences of find string
> 'abc abc abc' | str find-replace -a 'b' 'z'
Find and replace all occurrences of find string in table
> [[ColA ColB ColC]; [abc abc ads]] | str find-replace -a 'b' 'z' ColA ColC