From e30d3046473f7c8e9e973525c2a4b1bac3f2d8a3 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 28 Mar 2023 11:24:18 -0400 Subject: [PATCH] Convert from perl regex to ext regex --- lug-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 92033fe..9dead39 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1389,7 +1389,7 @@ download_install() { fi # Get the selected download url - download_url="$(curl -s "$contributor_url$query_string" | grep -o "$search_key.*$download_file" | cut -d \" -f3)" + download_url="$(curl -s "$contributor_url$query_string" | grep -Eo "\"$search_key\": ?\"[^\"]+$download_file\"" | cut -d '"' -f4)" # Sanity check if [ -z "$download_url" ]; then @@ -1644,7 +1644,7 @@ download_select_install() { unset download_versions while IFS='' read -r line; do download_versions+=("$line") - done < <(curl -s "$contributor_url$query_string" | grep -Po "$search_key.*?[^\\\](\",|\$)" | cut -d \" -f3 | xargs basename -a) + done < <(curl -s "$contributor_url$query_string" | grep -Eo "\"$search_key\": ?\"[^\"]+\"" | cut -d '"' -f4 | xargs basename -a) # Note: match from search_key until ", or EOL (Handles embedded commas and escaped quotes) # Sanity check