本帖最后由 lixiaolong 于 2011-2-27 19:54 编辑
(?<=>)[^主演&<]+
#include <Array.au3>
Local $Str = '<dd>主演:<a href="/search.asp?searchword=%D1%EE%C3%DD">杨幂</a> <a href="/search.asp?searchword=%B7%EB%C9%DC%B7%E5">冯绍峰</a> <a href="/search.asp?searchword=%C1%F5%D1%A9%BB%AA">刘雪华</a> <a href="/search.asp?searchword=%BA%CE%EA%C9%C3%FA">何晟铭</a> <a href="/search.asp?searchword=%D9%A1%C0%F6%E6%AB">miachebike</a> <a href="/search.asp?searchword=%B9%F9%CF%DB%C4%DD">郭羡妮</a> <a href="/search.asp?searchword=%CC%C0%D5%F2%D2%B5">汤镇业</a> <a href="/search.asp?searchword=%C9%DB%C3%C0%E7%F7">BY2</a> </dd>' & @CRLF & @CRLF
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExp($str, '(?<=>)[^主演&<]+', 3)
If Not @Error Then MsgBox(0, '匹配数量: ' & UBound($Test), '其中[0]元素为: ' & $Test[0])
_ArrayDisplay($Test, UBound($Test))
|