I'm trying to create a list of all occurrences of variables in an Autoit file. Unfortunately, my regex skills suck badly.
I found a snippet elsewhere here, which at first glance, works pretty well...
...but doesn't grab variables in situations like this:
_ArraySort($aBefore)
or
_ArrayDelete($aSkills, 0)
Appreciate any help. Here's the code so far:
I found a snippet elsewhere here, which at first glance, works pretty well...
$aArray = StringRegExp($varFileContents, "(\$\w{1,50})(?:\s|\[)", 3)
...but doesn't grab variables in situations like this:
_ArraySort($aBefore)
or
_ArrayDelete($aSkills, 0)
Appreciate any help. Here's the code so far:
[ autoit ]
#include <Array.au3> ; Select file While 1 $filename = FileOpenDialog("Select a file", @DesktopCommonDir, "AU3 files (*.au3)", 1) If $filename <> "" Then ExitLoop Else $answer = MsgBox(36, "Check Variables", "No file selected. Exit Program?") If $answer = 6 Then Exit EndIf WEnd $varFileContents = FileRead($filename) $aArray = StringRegExp($varFileContents, "(\$\w{1,50})(?:\s|\[)", 3) _ArraySort($aArray) _ArrayDisplay($aArray)