Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Find all words starting with...

$
0
0
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...

$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)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>