Closed parlevjo2 closed 7 months ago
So currently, I have this regex with matches only strings in an assignment and this code which doesn't fully work
else if RegexMatch(Line, "i)^([\s]*[a-z_][a-z_0-9]*[\s]*:=\s*)(.*)", &Equation) ; Line is a variable assignment, check for ""
{ ; Replace "" with `", see #111
Line := Equation[1]
pos := RegExMatch(Equation[2], "`"((?:`"`")?(?:[^`"]*(?:`"`")?[^`"]*?)*?(?:`"`")?)`"", &match) ; https://regex101.com/r/RMoJ06/2
if pos != 0
Line .= "`"" RegExReplace(match[1], "`"`"", "```"") "`""
}
So it still doesn't add in variables or other strings if multiple
This v1 line
Clipboard := "Powershell -command ""Get-CimInstance -ClassName win32_operatingsystem | Select-Object CSName, LastBootUpTime | FT -Autosize"""
is translated to v2 lineA_Clipboard := "Powershell -command ""Get-CimInstance -ClassName win32_operatingsystem | Select-Object CSName, LastBootUpTime | FT -Autosize"""
Must be using escaped quote otherwise it gives an autohotkey errorA_Clipboard := "Powershell -command
"Get-CimInstance -ClassName win32_operatingsystem | Select-Object CSName, LastBootUpTime | FT -Autosize""