From 0fb614940f002832aeab64c8add7c5a66e18b5cf Mon Sep 17 00:00:00 2001 From: David Daily Date: Fri, 14 Jul 2023 11:10:18 -0500 Subject: [PATCH] update regex for ini key search --- func.ahk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/func.ahk b/func.ahk index cc8d08d..73151fa 100644 --- a/func.ahk +++ b/func.ahk @@ -102,9 +102,8 @@ ini_write(location, inKey, inValue) ; Don't need to specify section because you file := FileOpen(location, "r") temp := file.Read() file.Close() - inKey := "(?<=" inKey "=)\S*" ; Regex to make sure we're matching only the value for the requested key - temp := RegExReplace(temp, inKey, inValue) - ; msgbox, % temp "`n`nRegex:`t" inKey "`nReplacing match with:`t" inValue + inKeyReg := "(?<=^" inKey "=)\S*" ; Regex to make sure we're matching only the value for the requested key + temp := RegExReplace(temp, inKeyReg, inValue) file := FileOpen(location, "w") file.Write(temp) file.Close()