#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\<p\s+?\/\>[ ]?"
Local $sString = "<?xml version="1.0" encoding="utf-8"?>" & @CRLF & _
"<Data>" & @CRLF & _
" <Text number="1">" & @CRLF & _
" <Title>Lazy dog jumper</Title>" & @CRLF & _
" <Description><arg format="x" /><p /> The quick <p /> brown fox <p /> jumps <p /> over the <p /> lazy dog.<p />The quick brown fox jumps <p />over the lazy dog.<p /> The quick brown fox jumps over the lazy dog. <p /></Description>" & @CRLF & _
" </Text>" & @CRLF & _
" <Text number="2">" & @CRLF & _
" <Title>Lazy foxer</Title>" & @CRLF & _
" <Description>The quick brown fox <arg format="x" /><p />jumps <p>asdf</p> over the lazy dog <p /></Description>" & @CRLF & _
" </Text>" & @CRLF & _
" <Text number="3">" & @CRLF & _
" <Title>Quickest jumper</Title>" & @CRLF & _
" <Description>The quickest brown fox jumps over the lazy dog <p /> The slowest brown fox jumps over the laziest dog. <p /></Description>" & @CRLF & _
" </Text>" & @CRLF & _
"</Data>"
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