From 662d7b566fe086fe54b659cd88be6d919319e26a Mon Sep 17 00:00:00 2001 From: Bahex <17417311+Bahex@users.noreply.github.com> Date: Sun, 4 May 2025 10:18:19 +0300 Subject: [PATCH] fix(cell-path): quote cell-path members containing '?' and '!' --- crates/nu-utils/src/quoting.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-utils/src/quoting.rs b/crates/nu-utils/src/quoting.rs index 35ca0711bd..0e713c9d80 100644 --- a/crates/nu-utils/src/quoting.rs +++ b/crates/nu-utils/src/quoting.rs @@ -2,12 +2,12 @@ use fancy_regex::Regex; use std::sync::LazyLock; // This hits, in order: -// • Any character of []:`{}#'";()|$,. +// • Any character of []:`{}#'";()|$,.!? // • Any digit (\d) // • Any whitespace (\s) // • Case-insensitive sign-insensitive float "keywords" inf, infinity and nan. static NEEDS_QUOTING_REGEX: LazyLock = LazyLock::new(|| { - Regex::new(r#"[\[\]:`\{\}#'";\(\)\|\$,\.\d\s]|(?i)^[+\-]?(inf(inity)?|nan)$"#) + Regex::new(r#"[\[\]:`\{\}#'";\(\)\|\$,\.\d\s!?]|(?i)^[+\-]?(inf(inity)?|nan)$"#) .expect("internal error: NEEDS_QUOTING_REGEX didn't compile") });