Alright here ya go:
^(local)?(\s)\*(\w)\*(\s)\*[=](\s)\*[function]\*(\s)\*(\w)\*[(]\*(\w)\*[)]\*
I tested the matching using the following website
http://myregexp.com/
using the following data:
local foo = function fooFunc()
end
local myvar = function myFunction()
end
sooper = function sooperFunc()
end
local test = function testFunc(params)
end
test2 = function testFunc2(params)
end
If you enter the above into the applet, and check the multiline checkbox, it will highlight the appropriate lines in the test data, and skip the lines with “end”.
Does that help out?
edit: the above code also takes into account that you could pass in words as arguments to the function. I think I used the * so it can accept any number of words, but that may need to be tweeked, since you need to account for a comma (,) for multiple words passed in…I think. A quick test should tell me.
edit again:
This
^(local)?(\s)\*(\w)\*(\s)\*[=](\s)\*[function]\*(\s)\*(\w)\*[(]\*(\w[,]\*(\s)\*)\*[)]\*
picks up everything above and the following cases
local test = function test(word, word2, wordagain)
and the same without the local at the front. [import]uid: 5317 topic_id: 7025 reply_id: 46320[/import]