diff --git a/crates/nu-command/src/strings/str_/expand.rs b/crates/nu-command/src/strings/str_/expand.rs index de11f10c47..7cbc8d170b 100644 --- a/crates/nu-command/src/strings/str_/expand.rs +++ b/crates/nu-command/src/strings/str_/expand.rs @@ -48,6 +48,30 @@ impl Command for SubCommand { },) }, + Example { + description: "Ignore the next character after the backslash ('\\')", + example: "'A{B\\,,C}' | str expand", + result: Some(Value::List{ + vals: vec![ + Value::test_string("AB,"), + Value::test_string("AC"), + ], + span: Span::test_data() + },) + }, + + Example { + description: "Use double backslashes to add a backslash.", + example: "'A{B\\\\,C}' | str expand", + result: Some(Value::List{ + vals: vec![ + Value::test_string("AB\\"), + Value::test_string("AC"), + ], + span: Span::test_data() + },) + }, + Example { description: "Export comma separated values inside braces (`{}`) to a string list.", example: "\"{apple,banana,cherry}\" | str expand",