#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?ms)^(\d+)\. ?(.+?)(?:value|vlaue|balue|valie): ?(.+?)[\n\r]{2,}"
Local $sString = "Some junk data" & @CRLF & _
"More junk data " & @CRLF & _
"" & @CRLF & _
"1. fairly long key, all on one line" & @CRLF & _
"value: some other text with spaces and stuff" & @CRLF & _
"" & @CRLF & _
"Some junk data" & @CRLF & _
"" & @CRLF & _
"More junk data " & @CRLF & _
"" & @CRLF & _
"2. hey look! another long " & @CRLF & _
"and broken key. on two lines" & @CRLF & _
"value: a different value with some different information" & @CRLF & _
"" & @CRLF & _
"Some junk data" & @CRLF & _
"More junk data " & @CRLF & _
"" & @CRLF & _
"3. hey look! another long line. on a line" & @CRLF & _
"value: a different value " & @CRLF & _
"broken, with some different information" & @CRLF & _
"" & @CRLF & _
"Some junk data" & @CRLF & _
"More junk data "
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