#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)(?<=has been denied).*(401 to \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})"
Local $sString = "2016-02-14 15:55:39.1094 Info HttpServer: HTTP Response 200 to 192.168.0.3. Time: 3ms. https://192.168.0.10:8920/emby/users/public" & @CRLF & _
"2016-02-14 15:55:43.8597 Info HttpServer: HTTP POST https://192.168.0.10:8920/emby/Users/authenticatebyname. UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" & @CRLF & _
"2016-02-14 15:55:43.8718 Info UserManager: Authentication request for <username> has been denied." & @CRLF & _
"2016-02-14 15:55:43.8820 Error DtoUtils: ServiceBase<TRequest>::Service Exception" & @CRLF & _
" *** Error Report ***" & @CRLF & _
" Version: 3.0.5821.0" & @CRLF & _
" Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh" & @CRLF & _
" Operating system: Unix 3.19.0.25" & @CRLF & _
" Processor count: 8" & @CRLF & _
" 64-Bit OS: True" & @CRLF & _
" 64-Bit Process: True" & @CRLF & _
" Program data path: /var/lib/emby-server" & @CRLF & _
" Mono: 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Dec 3 04:04:55 UTC 2015)" & @CRLF & _
" Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe" & @CRLF & _
" Invalid user or password entered." & @CRLF & _
" MediaBrowser.Controller.Net.SecurityException" & @CRLF & _
" at MediaBrowser.Server.Implementations.Session.SessionManager+<AuthenticateNewSession>c__asyncC.MoveNext () <0x41c76b00 + 0x0080b> in <filename unknown>:0" & @CRLF & _
" --- End of stack trace from previous location where exception was thrown ---" & @CRLF & _
" at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7fa7314f36d0 + 0x00029> in <filename unknown>:0" & @CRLF & _
" at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7fa7314f16b0 + 0x000a7> in <filename unknown>:0" & @CRLF & _
" at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7fa7314f1630 + 0x0006b> in <filename unknown>:0" & @CRLF & _
" at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7fa7314f15e0 + 0x0003a> in <filename unknown>:0" & @CRLF & _
" at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x7fa7314f1d10 + 0x00017> in <filename unknown>:0" & @CRLF & _
" at MediaBrowser.Api.UserService+<Post>c__async1.MoveNext () <0x41c75ea0 + 0x00680> in <filename unknown>:0" & @CRLF & _
"" & @CRLF & _
"2016-02-14 15:55:43.8849 Error HttpServer: Error processing request for /emby/Users/authenticatebyname" & @CRLF & _
" *** Error Report ***" & @CRLF & _
" Version: 3.0.5821.0" & @CRLF & _
" Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh" & @CRLF & _
" Operating system: Unix 3.19.0.25" & @CRLF & _
" Processor count: 8" & @CRLF & _
" 64-Bit OS: True" & @CRLF & _
" 64-Bit Process: True" & @CRLF & _
" Program data path: /var/lib/emby-server" & @CRLF & _
" Mono: 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Dec 3 04:04:55 UTC 2015)" & @CRLF & _
" Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe" & @CRLF & _
" Invalid user or password entered." & @CRLF & _
" ServiceStack.HttpError" & @CRLF & _
" No Stack Trace Available" & @CRLF & _
"" & @CRLF & _
"2016-02-14 15:55:43.8913 Info HttpServer: HTTP Response 401 to 192.168.0.3. Time: 32ms. https://192.168.0.10:8920/emby/Users/authenticatebyname" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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