#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\([a-zA-Z]+\)\n(.+)"
Local $sString = "17." & @CRLF & _
"If you go on increasing the stretching force on a wire in a" & @CRLF & _
"guitar, its frequency." & @CRLF & _
"(a)" & @CRLF & _
"increases" & @CRLF & _
"(b)" & @CRLF & _
"decreases" & @CRLF & _
"(c)" & @CRLF & _
"remains unchanged" & @CRLF & _
"(d)" & @CRLF & _
"None of these" & @CRLF & _
"" & @CRLF & _
"some random text between questions" & @CRLF & _
"18." & @CRLF & _
"A vibrating body" & @CRLF & _
"(a)" & @CRLF & _
"will always produce sound" & @CRLF & _
"(b)" & @CRLF & _
"may or may not produce sound if the amplitude of" & @CRLF & _
"vibration is low" & @CRLF & _
"(c)" & @CRLF & _
"will produce sound which depends upon frequency" & @CRLF & _
"(d)" & @CRLF & _
"None of these" & @CRLF & _
"19." & @CRLF & _
"The wavelength of infrasonics in air is of the order of" & @CRLF & _
"(a)" & @CRLF & _
"100 m" & @CRLF & _
"(b)" & @CRLF & _
"101 m" & @CRLF & _
"(c)" & @CRLF & _
"10–1 m" & @CRLF & _
"(d)" & @CRLF & _
"10–2 m"
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