#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:for\(.*<\W?)(([\w]+)\.?)+(?:\[?)|(?:\.length)"
Local $sString = "for($j = 0; $j < incomingData.customer['data'].length; $j++){" & @CRLF & _
"" & @CRLF & _
"for(c=a.children.length-1;0<=c;c--)d" & @CRLF & _
"" & @CRLF & _
"for(l=0;l<g.length;l++){d=g[l]" & @CRLF & _
"" & @CRLF & _
"for(h in b)if(!h.match(d||/margin|text\-align|width|border|padding/i))if(g)g=!1;else{var l=new CKEDITOR.htmlParser.element("span");l.attributes.style=h+":"+b[h];c.add(l);c=l;delete b[h]}CKEDITOR.tools.isEmpty(b)?delete a.attributes.style:a.attributes.style=CKEDITOR.tools.writeCssText(b);for(b=0;b<e.length;b++)c.add(e[b])},sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=m.parseCssText(a.attributes.style),d=m.objectKeys(c),e=[],g=[],h=0;h<d.length;h++)" & @CRLF & _
"" & @CRLF & _
"for(var f=0,n=0,l=0,p,e=a.$.rows.length;l<e;l++)" & @CRLF & _
"" & @CRLF & _
"for(var i = 0; i < this.audioLayerControl.listOfSequenceEditors.length; ++i)" & @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