#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^.{0,1}(陪我一起)?听?你?(再|快|先)?能?(给我)?唱?(啊|一?个|吧|出来|一?首)?歌?(给我听|来听听)?(吧|啊|哇|呗|呀)?((好(么|嘛|吗))|好不好|小万|亲爱的|这么难)?.{0,1}$"
Local $sString = "你先唱给我听好吗" & @CRLF & _
"快唱啊" & @CRLF & _
"快唱啊你" & @CRLF & _
"" & @CRLF & _
"你唱吧" & @CRLF & _
"你唱一个" & @CRLF & _
"唱一首吧亲爱的" & @CRLF & _
"再唱一首" & @CRLF & _
"你快唱吧" & @CRLF & _
"你能唱出来吗" & @CRLF & _
"唱出来" & @CRLF & _
"唱一个给我听呗好不好" & @CRLF & _
"快唱" & @CRLF & _
"唱" & @CRLF & _
"唱吧" & @CRLF & _
"你唱啊" & @CRLF & _
"唱一个嘛" & @CRLF & _
"唱一个啊" & @CRLF & _
"来听你唱歌" & @CRLF & _
"再给我唱一首呗" & @CRLF & _
"唱歌小万" & @CRLF & _
"你唱首歌给我听呗" & @CRLF & _
"陪我一起唱歌好吗" & @CRLF & _
"听你唱歌这么难" & @CRLF & _
"唱首歌来听听" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"你唱歌好好听啊再给我唱一首呗" & @CRLF & _
"" & @CRLF & _
"我现在就很不开心你唱首歌给我听呗" & @CRLF & _
"" & @CRLF & _
"会不会唱歌,唱首歌来听听"
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