Fixed the program with a quick change to the code (to handle the dollar sign)

This commit is contained in:
techmetx11 2024-06-27 23:24:46 +01:00
parent f70c60441a
commit 062de1e172
No known key found for this signature in database
GPG Key ID: E60B63635FF4E062

View File

@ -70,7 +70,7 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
let mut nsig_array_context_regex: String = String::new(); let mut nsig_array_context_regex: String = String::new();
nsig_array_context_regex += "var "; nsig_array_context_regex += "var ";
nsig_array_context_regex += nsig_array_name; nsig_array_context_regex += &nsig_array_name.replace("$", "\\$");
nsig_array_context_regex += "\\s*=\\s*\\[(.+?)][;,]"; nsig_array_context_regex += "\\s*=\\s*\\[(.+?)][;,]";
let nsig_array_context = match Regex::new(&nsig_array_context_regex) { let nsig_array_context = match Regex::new(&nsig_array_context_regex) {
@ -95,7 +95,7 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
// Extract nsig function code // Extract nsig function code
let mut nsig_function_code_regex_str: String = String::new(); let mut nsig_function_code_regex_str: String = String::new();
nsig_function_code_regex_str += nsig_function_name; nsig_function_code_regex_str += &nsig_function_name.replace("$", "\\$");
nsig_function_code_regex_str += nsig_function_code_regex_str +=
"=\\s*function([\\S\\s]*?\\}\\s*return [\\w$]+?\\.join\\(\"\"\\)\\s*\\};)"; "=\\s*function([\\S\\s]*?\\}\\s*return [\\w$]+?\\.join\\(\"\"\\)\\s*\\};)";