update regex for ini key search

This commit is contained in:
David Daily 2023-07-14 11:10:18 -05:00
parent de5e7b88e6
commit 0fb614940f
1 changed files with 2 additions and 3 deletions

View File

@ -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()