#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(function)?\s*doFilter\s*(:|=)?\s*(function)?\s*\("
Local $sString = "doFilter : function(){" & @CRLF & _
" var filters = $$('#'+this.containerId+' .filter input', '#'+this.containerId+' .filter select');" & @CRLF & _
" var elements = [];" & @CRLF & _
" for(var i in filters){" & @CRLF & _
" if(filters[i].value && filters[i].value.length) elements.push(filters[i]);" & @CRLF & _
" }" & @CRLF & _
" if (!this.doFilterCallback || (this.doFilterCallback && this.doFilterCallback())) {" & @CRLF & _
" this.reload(this.addVarToUrl(this.filterVar, encode_base64(Form.serializeElements(elements))));" & @CRLF & _
" }" & @CRLF & _
" }," & @CRLF & _
"doFilter = function(){" & @CRLF & _
" this.reload(this.addVarToUrl(this.filterVar, ''));" & @CRLF & _
"}," & @CRLF & _
"function doFilter(grid, event){" & @CRLF & _
" var element = Event.findElement(event, 'tr');" & @CRLF & _
" if(['a', 'input', 'select', 'option'].indexOf(Event.element(event).tagName.toLowerCase())!=-1) {" & @CRLF & _
" return;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" if(element.title){" & @CRLF & _
" setLocation(element.title);" & @CRLF & _
" }" & @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