(?i)(?<=alertpay value=)(.*?) type=radio paypal.png
#include <Array.au3>
Local $Str = _
';原字串有许多行,现简化如下:' & @CRLF & _
'$qfehtml="value=7 type=radio alertpay value=9 type=radio paypal.png"' & @CRLF & @CRLF & _
';我写的正则表达式,目的是想提取value=9的数字9,但达不到目的。' & @CRLF & _
"$word='paypal';限定关键词是想提取对应的数字。" & @CRLF & _
"$pay = StringRegExp($qfehtml, '(?is)value=(\d+)\stype=radio.+?' & $word, 3)" & @CRLF
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExp($str, '(?i)(?<=alertpay value=)(.*?) type=radio paypal.png', 3)
If Not @Error Then MsgBox(0, '匹配数量: ' & UBound($Test), '其中[0]元素为: ' & $Test[0])
_ArrayDisplay($Test, UBound($Test))
|