#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?:\s|\\n\\n)*(?<subject>\S+(?:\s[IVX]+\.?)?)(?:\s|\\n\\n)+(?<teacher>\S+)(?:\s|\\n\\n)+(?<room>\S+)(?:\s|\\n\\n)*"
Local $sString = "TSG MUM \n\nBS06-312" & @CRLF & _
"RQWE. FKB \n\nBS06-204" & @CRLF & _
"NM. JAK \n\nBS06-E05" & @CRLF & _
"DB. FKB \n\nBS06-312" & @CRLF & _
"IGT. resetk \n\nWender." & @CRLF & _
"ENG I. \n\nWEHN BS06-E06 \n\nENG II \n\nFLEM BS06-203" & @CRLF & _
"ITSI. MUM \n\nBS06-E02" & @CRLF & _
"PQT. RIE \n\nBS11-QCR PQT \n\nMARK BS11-QCR \n\nPQT FIS \n\nBS11-QCR" & @CRLF & _
"INC FEY \n\nBS06-309" & @CRLF & _
"ABS. DOE \n\nBS06 ABS \n\nVOG BS06 \n\nABS HEI \n\nBS06 ABS \n\nMOR BS06 \n\nABS REM \n\nBS06 ABS \n\nDEI BS06 \n\nABS THA \n\nBS06" & @CRLF & _
"ENG III. \n\nGLIT BS06-209 \n\nENG II \n\nWANN BS06-208"
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