hey guys, i'm trying to use regex to find variable names/functions/labels etc in ahk code as i wish to manipulate this code using AHK
it appears one of the hardest things to do in AHK is get it to understand itself :p

currently i'm looking at finding := and whatever is before it is a variable but ofcourse, variables in AHK can be defined in various ways, which leads to the problem
likewise with function names and labels, so on
is there any regex gurus out there that could verify if this is even possible?

here's a small snippet of the code that handles finding variable names, and it does a fairly decent job but it's not thorough by any means, the input of it is A_Loopreadline

wow, spot on it doesn't matter if it finds function declaration or function call, so long as it finds one of them, it's variables that are the tricky one

this works brilliantly, exactly what i need, even finds more than i want, though the question still remains about variables, i guess some vars are found in the sense of func(var,var) {} (one of the ways of creating variables without declaring it) so it clears that base up at least

i'll check the others out now but i'm trying to think of all the ways a var can be created

var :=
var =
var+=
func(var := )
return var?

so on

my script finds := (as first post says)
and it returns a decent ammount (around 170 for my particular script) but i suspect it will be missing a lot :p

so aside from := ( = is a bit trickier, += is simple enough to implement)
and local vars for each function, i'd imagine that would cover MOST bases for variables?