From 286395a230d9b047904d7430cbd991c0f37d93d4 Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Thu, 22 Dec 2022 19:50:00 -0800 Subject: [PATCH] :pencil2: Small diff in dye's implementation of regex --- scripts/dye | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dye b/scripts/dye index aecef630..76862632 100755 --- a/scripts/dye +++ b/scripts/dye @@ -77,7 +77,7 @@ hex_to_rgb() { # parse_rgb() takes rgb string to pass to rgb_to_hex() parse_rgb() { - local regex='^\s?rgb[a]?[(][0-9]{1,3}, [0-9]{1,3}, [0-9]{1,3}[)]$|^rgb[a]?[(][0-9]{1,3}, [0-9]{1,3}, [0-9]{1,3}, [0-1]?.[0-9][0-9]?[)]\s?$' + local regex='^rgb[a]?[(][0-9]{1,3}, [0-9]{1,3}, [0-9]{1,3}[)]$|^rgb[a]?[(][0-9]{1,3}, [0-9]{1,3}, [0-9]{1,3}, [0-1]?.[0-9][0-9]?[)]$' if [[ $2 =~ $regex ]]; then local numbers numbers=$(echo "$2" | sed -n 's/.*\(([^()]*)\).*/\1/p' | sed 's/[()]//g' | sed 's/,\s/ /g')