#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = ".+?snuffs out the (\d+).. fire pit, and in seconds.+"
Local $sString = "\#58FAACQaaron snuffs out the 1st fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 2nd fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 3rd fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 4th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 5th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 6th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 7th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 8th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 9th fire pit, and in seconds the connecting bridge will also be extinguished!" & @CRLF & _
"" & @CRLF & _
"\#58FAACQaaron snuffs out the 10th fire pit, and in seconds the connecting bridge will also be extinguished!"
Local $sSubst = "Bridge $1"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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