diff --git a/crates/nu-command/src/filters/find.rs b/crates/nu-command/src/filters/find.rs index f1c473d43..f99835462 100644 --- a/crates/nu-command/src/filters/find.rs +++ b/crates/nu-command/src/filters/find.rs @@ -187,9 +187,23 @@ fn find_with_regex( .map_err(|e| ShellError::UnsupportedInput(format!("incorrect regex: {}", e), span))?; input.filter( - move |value| { - let string = value.into_string(" ", &config); - re.is_match(string.as_str()) != invert + move |value| match value { + Value::String { val, .. } => re.is_match(val.as_str()) != invert, + Value::Record { cols: _, vals, .. } => { + let matches: Vec = vals + .iter() + .map(|v| re.is_match(v.into_string(" ", &config).as_str()) != invert) + .collect(); + matches.iter().any(|b| *b) + } + Value::List { vals, .. } => { + let matches: Vec = vals + .iter() + .map(|v| re.is_match(v.into_string(" ", &config).as_str()) != invert) + .collect(); + matches.iter().any(|b| *b) + } + _ => false, }, ctrlc, )