#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)([\w\*]+(\s)*?){2,4}\(([^!@#$+%^;]*?)\)\s*{"
Local $sString = "int test()" & @CRLF & _
"{" & @CRLF & _
"int test(int a) {" & @CRLF & _
"int test(int a, int b){" & @CRLF & _
"int test(int a,int b) {" & @CRLF & _
"_int _test(string * b){" & @CRLF & _
"int test (string b)" & @CRLF & _
"{" & @CRLF & _
"int test (string b) {" & @CRLF & _
"" & @CRLF & _
"int" & @CRLF & _
"b " & @CRLF & _
"(int a)" & @CRLF & _
"{" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"test:" & @CRLF & _
"int test();" & @CRLF & _
" static int main(){" & @CRLF & _
"_static _void _itnt * main(){" & @CRLF & _
"" & @CRLF & _
"static timerr iftnst" & @CRLF & _
"" & @CRLF & _
"([A-z_]+\ *){3}(\(.*\))" & @CRLF & _
"Copyright (C) Stefan Frings"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm