#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\|\s+\d+:\d+:\d+\s+\|\s+(failed|passed)\s+\|\s+([^\|]+)\s+\|\s+(.*)$"
Local $sString = "[ i ] PROCESS SUITES/TESTS RESULTS ..." & @CRLF & _
"-------------------------------------------------------------------------------" & @CRLF & _
" Suite: acceptance_ui_account (1 tests)" & @CRLF & _
"-------------------------------------------------------------------------------" & @CRLF & _
" failed: 1" & @CRLF & _
"-------------------------------------------------------------------------------" & @CRLF & _
"| 00:00:05 | failed | User can log in | user/login/alice.yml" & @CRLF & _
"| 00:00:12 | passed | User can log in | user/login/bob.yml" & @CRLF & _
"| 00:00:18 | passed | User can log in | user/login/charlie.yml" & @CRLF & _
"-------------------------------------------------------------------------------" & @CRLF & _
" Suite start time : 12:41:09" & @CRLF & _
" Suite end time : 12:41:27" & @CRLF & _
" Suite elapsed time: 00:00:18" & @CRLF & _
"-------------------------------------------------------------------------------" & @CRLF & _
"[ ! ] Failed tests list was stored in 'acceptance_ui_account' suite."
Local $sSubst = ""
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