From 5fd34320e9a4839dacdc0d335868cf7aac36d70d Mon Sep 17 00:00:00 2001 From: Maxim Uvarov Date: Sun, 21 Apr 2024 13:01:42 +0800 Subject: [PATCH] add search_term "str extract" to `parse` command (#12600) # Description For a long time, I was searching for the `str extract` command to extract regexes from strings. I often painfully used `str replace -r '(.*)(pattern_to_find)(.*)' '$2'` for such purposes. Only this morning did I realize that `parse` is what I needed for so many times, which I had only used for parsing data in tables. --- crates/nu-command/src/strings/parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/strings/parse.rs b/crates/nu-command/src/strings/parse.rs index 8b2323a04e..1ea2dfcd0f 100644 --- a/crates/nu-command/src/strings/parse.rs +++ b/crates/nu-command/src/strings/parse.rs @@ -19,7 +19,7 @@ impl Command for Parse { } fn search_terms(&self) -> Vec<&str> { - vec!["pattern", "match", "regex"] + vec!["pattern", "match", "regex", "str extract"] } fn signature(&self) -> nu_protocol::Signature {