#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)\d+\/\d+\/\d+\s+\d+:\d+:\d+\.\d+\s\w+\s+(?<session_io>\d+)"
Local $sString = " 12/27/17" & @CRLF & _
" 8:24:49.599 AM " & @CRLF & _
" 1514363089599 Groupon I will do my best to help you, please tell me more about the issue you are having. " & @CRLF & _
" host =instance-1 source =/var/www/html/backend/log_chat/conversation.log" & @CRLF & _
" " & @CRLF & _
" 12/27/17" & @CRLF & _
" 8:24:49.599 AM " & @CRLF & _
" 1514363089599 user i need help " & @CRLF & _
" host =instance-1 source =/var/www/html/backend/log_chat/conversation.log" & @CRLF & _
" " & @CRLF & _
" 12/27/17" & @CRLF & _
" 8:24:49.599 AM " & @CRLF & _
" 1514363089599 Groupon Hello! Thank you for contacting Groupon " & @CRLF & _
" host =instance-1 source =/var/www/html/backend/log_chat/conversation.log"
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