nushell/docs/commands/str-find-replace.md
Fernando Herrera dbcadbc12c moved folders
2022-02-07 19:23:12 +00:00

617 B

str find-replace

finds and replaces text

Usage

> str find-replace <find> <replace> ...args {flags} 

Parameters

  • <find> the pattern to find
  • <replace> the replacement pattern
  • ...args: optionally find and replace text by column paths

Flags

  • -h, --help: Display this help message
  • -a, --all: replace all occurrences of find string

Examples

Find and replace contents with capture group

> echo 'my_library.rb' | str find-replace '(.+).rb' '$1.nu'

Find and replace all occurrences of find string

> echo 'abc abc abc' | str find-replace -a 'b' 'z'