#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "[0-9]*.?"
Local $sString = "393. A gypsy caravan passes. They might have interesting items for sale or trade, but " & @CRLF & _
"they have touchy tempers and strange customs. They might even want to capture a " & @CRLF & _
"PC or pet to sell in the next town. " & @CRLF & _
"394. A thief tries to infiltrate the party to steal from them. " & @CRLF & _
"395. A fallen tree blocks the road ahead. You notice a path going around it but cannot " & @CRLF & _
"see the other side. " & @CRLF & _
"396. An nearby tree is infested with animated objects that attack travelers that disturb " & @CRLF & _
"their swarm. " & @CRLF & _
"3979. A press gang accosts travelers just down the road. " & @CRLF & _
"398. A mounted patrol of soldiers ask travellers what they have seen, then pass on the " & @CRLF & _
"King's warning to be law-abiding. " & @CRLF & _
"399. An otherwise empty stretch of highway, with two rival taverns facing each other " & @CRLF & _
"across the road. The publicans try to outdo each other loudly on the discounts and " & @CRLF & _
"benefits of their respective establishments to the party. Both seem desperate for " & @CRLF & _
"customers. "
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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