#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<([bi])>.*<\/\1>"
Local $sString = "I want to use regex to check if an HTML document contains at least one of all the tags below:" & @CRLF & _
"" & @CRLF & _
"<b> [content1] </b>" & @CRLF & _
"and" & @CRLF & _
"" & @CRLF & _
"<i> [content2] </i>" & @CRLF & _
"and" & @CRLF & _
"" & @CRLF & _
"<b> [content3] <i> [content4] </i> [content5] </b>" & @CRLF & _
"or" & @CRLF & _
"" & @CRLF & _
"<i> [content6] <b> [content7] </b> [content8] </i>" & @CRLF & _
"" & @CRLF & _
"'content' can be anything. Is there a way to achieve this"
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