#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)(\S*)\((?:[^)]|//[^\r\n]*\)|/\*(?:(?!\*/).)*\*/)*ref\s*SqlConnection"
Local $sString = "public static bool InsertNotes(string TableName, string TableKey, string DocType, string InsuredKey, string SubmissionKey," & @CRLF & _
" string Staff, string DefaultAction, string DisplayKey, FileType FileType, string IFSFileName," & @CRLF & _
" string IFSFolder, string IFSTimeStamp, string Subject, string Notation, NoteType NoteType," & @CRLF & _
" //string Company, string NoteCategory, ref OracleConnection Connection)" & @CRLF & _
" string Company, string NoteCategory, string DocumentName)" & @CRLF & _
" { //Stuff here" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"public static bool InsertNote1(string TableName, string TableKey, string DocType, string InsuredKey, string SubmissionKey," & @CRLF & _
" string Staff, string DefaultAction, string DisplayKey, FileType FileType, string IFSFileName," & @CRLF & _
" string IFSFolder, string IFSTimeStamp, string Subject, string Notation, NoteType NoteType," & @CRLF & _
" //string Company, string NoteCategory, ref OracleConnection Connection)" & @CRLF & _
" string Company, string NoteCategory, string DocumentName, ref SqlConnection Connection)" & @CRLF & _
" { //Stuff here" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"public static bool InsertNote2(string TableName, string TableKey, string DocType, string InsuredKey, string SubmissionKey," & @CRLF & _
" string Staff, string DefaultAction, string DisplayKey, FileType FileType, string IFSFileName," & @CRLF & _
" string IFSFolder, string IFSTimeStamp, string Subject, string Notation, NoteType NoteType," & @CRLF & _
" /*string Company, string NoteCategory, ref OracleConnection Connection)*/" & @CRLF & _
" string Company, string NoteCategory, string DocumentName, ref SqlConnection Connection)" & @CRLF & _
" { //Stuff here" & @CRLF & _
"}"
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