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.
This commit is contained in:
Maxim Uvarov 2024-04-21 13:01:42 +08:00 committed by GitHub
parent 5e52bd77e0
commit 5fd34320e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ impl Command for Parse {
} }
fn search_terms(&self) -> Vec<&str> { fn search_terms(&self) -> Vec<&str> {
vec!["pattern", "match", "regex"] vec!["pattern", "match", "regex", "str extract"]
} }
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {