#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?!<p style=".*?(margin-left:\s?(?!\k'margin')px;).*?">\* .*?<\/p>)<p style="(?P<styles>.*?)margin-left:\s?(?P<margin>[0-9]{1,3})px;?">\* (?P<listcontent>.*)<\/p>"
Local $sString = "<p style="color: blue">Some text</p>" & @CRLF & _
"<p style="color:blue; margin-left: 10px">* Item 1</p> (Should be matched)" & @CRLF & _
"<p style="margin-left: 10px">* Item 2</p>" & @CRLF & _
"<p style="margin-left: 20px">* Sub Item 1a</p> (Should be matched)" & @CRLF & _
"<p style="margin-left: 20px">* Sub Item 2a</p>" & @CRLF & _
"<p style="margin-left: 10px">* Item 3</p> " & @CRLF & _
"<p style="margin-left: 20px">* Sub Item 1b</p> (Should be matched)" & @CRLF & _
"<p style="margin-left: 20px">* Sub Item 2b</p>" & @CRLF & _
"<p style="margin-left: 30px">* Sub Item 1c</p>" & @CRLF & _
"<p>Some text</p>" & @CRLF & _
"<p style="color:blue; margin-left: 10px">* Item 1</p> (Should be matched)" & @CRLF & _
""
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