#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[a-zA-Z]+\d+|(?<=\d)[a-zA-Z]+"
Local $sString = "新发布的三星盖乐世S9采用Exynos9810处理器,RAM为4GB,电池容量为3000mAh。" & @CRLF & _
"期望将S9,Exynos9810,GB,mAh提取出来" & @CRLF & _
"" & @CRLF & _
"如何将一个句子中的英文词组或者英文+数字词组识别出来" & @CRLF & _
"新发布的三星盖乐世S9的特性如下:1.采用Exynos9810处理器;2.RAM为4GB;3.电池容量为3000mAh。" & @CRLF & _
"期望将S9,Exynos9810,GB,mAh提取出来,该用什么方法,希望得到各位的指点,谢谢。"
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