From c1e7e926b434a851640265f73f4cab849ad3aeb8 Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 25 Dec 2024 11:39:31 +0100 Subject: [PATCH] fix: :bug: match space before `(` and word boundary for the method name --- addons/mod_loader/internal/mod_hook_preprocessor.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mod_loader/internal/mod_hook_preprocessor.gd b/addons/mod_loader/internal/mod_hook_preprocessor.gd index 308f32d5..fd203351 100644 --- a/addons/mod_loader/internal/mod_hook_preprocessor.gd +++ b/addons/mod_loader/internal/mod_hook_preprocessor.gd @@ -15,11 +15,11 @@ const MOD_LOADER_HOOKS_START_STRING := \ "\n# ModLoader Hooks - The following code has been automatically added by the Godot Mod Loader." ## (? Ingore matches if 'func' is preceded by a '#' -## \bfunc\\s+ -> Match the word 'func' and one or more whitespace characters -## %s -> the function name -## (?:.*\\n*)*?\\( -> Match any character between zero and unlimited times, but be lazy +## \\bfunc\\s+ -> Match the word 'func' and one or more whitespace characters +## \\b%s -> the function name +## (?:.*\\n*)*?\\s*\\( -> Match any character between zero and unlimited times, but be lazy ## and only do this until a '(' is found. -const REGEX_MATCH_FUNC_WITH_WHITESPACE := "(?