#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<=\s)#\w+(?!.*[@$#])"
Local $sString = "1. While #EngineSpeed$b4tgup#" & @CRLF & _
"2. While #AcceleratorPedal$desddd# <=2" & @CRLF & _
"3. While #AcceleratorPeda@$desddd# <=2" & @CRLF & _
"4. While #AcceleratorPe#al$desddd# <=2" & @CRLF & _
"5. While #AcceleratorP@dal$desddd# <=2" & @CRLF & _
"6. While #AcceleratorPeda l$desddd# <=2" & @CRLF & _
"7. 设置 #AcceleratorPedal$y6qs8m#=@AcceleratorPedal+0.06" & @CRLF & _
"8. 设置 #WaitStart$jhx0vu#=11" & @CRLF & _
"9. 设置 #WaitStart$jhx0vu#^11" & @CRLF & _
"10. 设置 #WaitStart$jhx0vu#_11" & @CRLF & _
"11. 设置 #WaitStart$jhx0vu#-11" & @CRLF & _
"12. 设置 #AcceleratorQuora$yd6ba3#=1" & @CRLF & _
"13. 设置 #AcceleratorQuora$yd6bd3#=1" & @CRLF & _
"14." & @CRLF & _
"15. Check #EnginePower#" & @CRLF & _
"16. While #EngineSpeed" & @CRLF & _
"17. set #WaitStart" & @CRLF & _
"18. set #WaitStart<13" & @CRLF & _
"19. set #WaitStart<=13" & @CRLF & _
"20. set #WaitStart <= 13"
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