Hallo zusammen,
Ich versuche mich schon seit Stunden an einer Regex Anweisung um alle Globalen und Lokalen deklarierten Variablen aus einer AutoIt Datei zu Parsen und neu zu erstellen.
Mir geht es ABER darum, das ich aus:
[autoit]Global Const $ScriptDir = @ScriptDir, $__FILE__ = @ScriptFullPath
Global $DirTarget = $ScriptDir
Global $__Modus = 1, $__WriteToConsole = Not @Compiled, $__7zStatus, $__ReturnMsg
Local $Test = StringRegExpReplace(StringReplace($sString, "'", Chr(26), 0, 2), $sPattern, $sDummy)
das bekomme:
Global Const $ScriptDir = @ScriptDir
Global Const $__FILE__ = @ScriptFullPath
Global $DirTarget = $ScriptDir
Global $__Modus = 1
Global $__WriteToConsole = Not @Compiled
Global $__7zStatus
Global $__ReturnMsg
Local $Test = StringRegExpReplace(StringReplace($sString, "'", Chr(26), 0, 2), $sPattern, $sDummy)
Mein Pattern ist bis jetzt:
While 1
$Str = StringRegExpReplace($Str, "(?i)((?:Global|Local)(?: Const| Static)*)\h+(\$\w+)\h*(=\h*\w+.*\)|=\h*[\w@]+|=\h*[\x22']+.*[\x22']+|)\h*,\h*(\$.*)", "\1 \2\3"&@CRLF&"\1 \4")
If @Extended <= 0 Then ExitLoop
WEnd
Was aber leider immer noch nicht richtig funktioniert. Ich bin aber auch leider nicht so "der" regex profi, aber ggf kann mir ja jemand weiterhelfen