#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(^\w{3} \d{1,2} [0-9:]{8}) (\b\w+[.]\w*\b) +(\b\w*\b): (\b\w+\b) ([\w' ]*).*\(([\w.]*)\)$"
Local $sString = "Jan 31 00:09:39 ubuntu.local ticky: INFO Created ticket [#4217] (mdouglas)" & @CRLF & _
"Jan 31 00:16:25 ubuntu.local ticky: INFO Closed ticket [#1754] (noel)" & @CRLF & _
"Jan 31 00:21:30 ubuntu.local ticky: ERROR The ticket was modified while updating (breee)" & @CRLF & _
"Jan 31 00:44:34 ubuntu.local ticky: ERROR Permission denied while closing ticket (ac)" & @CRLF & _
"Jan 31 01:00:50 ubuntu.local ticky: INFO Commented on ticket [#4709] (blossom)" & @CRLF & _
"Jan 31 01:29:16 ubuntu.local ticky: INFO Commented on ticket [#6518] (rr.robinson)" & @CRLF & _
"Jan 31 01:33:12 ubuntu.local ticky: ERROR Tried to add information to closed ticket (mcintosh)" & @CRLF & _
"Jan 31 01:43:10 ubuntu.local ticky: ERROR Tried to add information to closed ticket (jackowens)" & @CRLF & _
"Jan 31 01:49:29 ubuntu.local ticky: ERROR Tried to add information to closed ticket (mdouglas)" & @CRLF & _
"Jan 31 02:30:04 ubuntu.local ticky: ERROR Timeout while retrieving information (oren)" & @CRLF & _
"Jan 31 02:55:31 ubuntu.local ticky: ERROR Ticket doesn't exist (xlg)" & @CRLF & _
"Jan 31 03:05:35 ubuntu.local ticky: ERROR Timeout while retrieving information (ahmed.miller)" & @CRLF & _
"Jan 31 03:08:55 ubuntu.local ticky: ERROR Ticket doesn't exist (blossom)" & @CRLF & _
"Jan 31 03:39:27 ubuntu.local ticky: ERROR The ticket was modified while updating (bpacheco)" & @CRLF & _
"Jan 31 03:47:24 ubuntu.local ticky: ERROR Ticket doesn't exist (enim.non)" & @CRLF & _
"Jan 31 04:30:04 ubuntu.local ticky: ERROR Permission denied while closing ticket (rr.robinson)" & @CRLF & _
"Jan 31 04:31:49 ubuntu.local ticky: ERROR Tried to add information to closed ticket (oren)" & @CRLF & _
"Jan 31 04:32:49 ubuntu.local ticky: ERROR Timeout while retrieving information (mcintosh)" & @CRLF & _
"Jan 31 04:44:23 ubuntu.local ticky: ERROR Timeout while retrieving information (ahmed.miller)" & @CRLF & _
"Jan 31 04:44:46 ubuntu.local ticky: ERROR Connection to DB failed (jackowens)" & @CRLF & _
"Jan 31 04:49:28 ubuntu.local ticky: ERROR Permission denied while closing ticket (flavia)" & @CRLF & _
"Jan 31 05:12:39 ubuntu.local ticky: ERROR Tried to add information to closed ticket (oren)" & @CRLF & _
"Jan 31 05:18:45 ubuntu.local ticky: ERROR Tried to add information to closed ticket (sri)" & @CRLF & _
"Jan 31 05:23:14 ubuntu.local ticky: INFO Commented on ticket [#1097] (breee)" & @CRLF & _
"Jan 31 05:35:00 ubuntu.local ticky: ERROR Connection to DB failed (nonummy)" & @CRLF & _
"Jan 31 05:45:30 ubuntu.local ticky: INFO Created ticket [#7115] (noel)" & @CRLF & _
"Jan 31 05:51:30 ubuntu.local ticky: ERROR The ticket was modified while updating (flavia)" & @CRLF & _
"Jan 31 05:57:46 ubuntu.local ticky: INFO Commented on ticket [#2253] (nonummy)" & @CRLF & _
"Jan 31 06:12:02 ubuntu.local ticky: ERROR Connection to DB failed (oren)"
Local $sSubst = " \1 \2"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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