#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\"error_description\"\:\"(?P<error_description>.\w+\s+\w+)"
Local $sString = ""error":"invalid_grant","error_description":"authentication failure"}"" & @CRLF & _
"[WARN ] 2016-06-15 17:55:03,835 ajp-bio-8009-exec-147: failed to unmarshall the body of the response:" & @CRLF & _
"{"error":"invalid_grant","error_description":"authentication failure"}" & @CRLF & _
"javax.xml.bind.UnmarshalException" & @CRLF & _
" - with linked exception:" & @CRLF & _
"[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.]" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:514)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:215)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)" & @CRLF & _
" at com.cisco.hn.cs.common.http.client.RestClientErrorHandler.handleError(RestClientErrorHandler.java:41)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:486)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:443)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401)" & @CRLF & _
" at org.springframework.web.client.Res[WARN ] 2016-06-15 17:55:03,835 ajp-bio-8009-exec-147: failed to unmarshall the body of the response:" & @CRLF & _
"{"error":"invalid_grant","error_description":"authentication failure"}" & @CRLF & _
"javax.xml.bind.UnmarshalException" & @CRLF & _
" - with linked exception:" & @CRLF & _
"[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.]" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:514)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:215)" & @CRLF & _
" at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)" & @CRLF & _
" at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)" & @CRLF & _
" at com.cisco.hn.cs.common.http.client.RestClientErrorHandler.handleError(RestClientErrorHandler.java:41)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:486)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:443)" & @CRLF & _
" at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401)" & @CRLF & _
" at org.springframework.web.client.Res"
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