#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\d{1,3}\.\s[a-zA-Z\d\?\.\s].+$\n\s(a?\)\s[a-zA-Z].+).+\n\s(b?\)\s[A-Za-z].+).+\n\s(c\).[a-zA-Z].+)"
Local $sString = "617. What would you like to eat for lunch? …, I don’t mind." & @CRLF & _
" a) Nothing" & @CRLF & _
" b) Anything" & @CRLF & _
" c) Something" & @CRLF & _
"618. Where do you want to go on holiday? … with a beach." & @CRLF & _
" a) Somewhere" & @CRLF & _
" b) Nowhere" & @CRLF & _
"613. You look familiar. Haven’t I seen you … before?" & @CRLF & _
" a) nowhere" & @CRLF & _
" b) anywhere" & @CRLF & _
" c) somewhere" & @CRLF & _
"614. She left the room without saying … ." & @CRLF & _
" a) nothing" & @CRLF & _
" b) anything" & @CRLF & _
" c) everything" & @CRLF & _
"615. I have never been … more beautiful than Thailand." & @CRLF & _
" a) somewhere" & @CRLF & _
" b) nowhere" & @CRLF & _
" c) anywhere" & @CRLF & _
"616. Who was at the party? …, so something very bad must have happened." & @CRLF & _
" a) No one" & @CRLF & _
" b) Anyone" & @CRLF & _
" c) Everyone" & @CRLF & _
"617. What would you like to eat for lunch? …, I don’t mind." & @CRLF & _
" a) Nothing" & @CRLF & _
" b) Anything" & @CRLF & _
" c) Something" & @CRLF & _
"618. Where do you want to go on holiday? … with a beach." & @CRLF & _
" a) Somewhere" & @CRLF & _
" b) Nowhere" & @CRLF & _
" c) Anywhere" & @CRLF & _
"619. I have … to say to you. Goodbye!" & @CRLF & _
" a) nothing" & @CRLF & _
" b) everything" & @CRLF & _
" c) something" & @CRLF & _
"620. I felt so good being on stage. I was sure that … was looking at me." & @CRLF & _
" a) someone" & @CRLF & _
" b) everyone" & @CRLF & _
" c) no one" & @CRLF & _
"621. Can you please … some money until next week?" & @CRLF & _
" a) lend " & @CRLF & _
" b) borrow" & @CRLF & _
" c) give" & @CRLF & _
"622. I decided to invest in the commodities as the … on offer from bank was extremely low." & @CRLF & _
" a) tax " & @CRLF & _
" b) rent " & @CRLF & _
" c) interest" & @CRLF & _
"623. Many retailers refuse to exchange purchases unless you can show them your … ." & @CRLF & _
" a) receipt" & @CRLF & _
" b) bill" & @CRLF & _
" c) Anywhere" & @CRLF & _
"619. I have … to say to you. Goodbye!" & @CRLF & _
" a) nothing"
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