本帖最后由 xzxnovice 于 2013-10-30 14:53 编辑
回复 8# afan
这个可以,收下。。。。谢谢各位
另外:
我用4的目的是这样的,可能我对4的功能不够理解。
先捉name id 这组$exp = StringRegExp($html, '"name":"(.*?)","id":"(.*?)"', 4)
If @error = 0 Then
For $i=0 To UBound($Exp)-1
$tmpary=$exp[$i]
For $j=0 To UBound($tmpary)-1
ConsoleWrite($tmpary[$j]&@CRLF)
Next
ConsoleWrite(@CRLF)
Next
EndIf
结果为"name":"410acec","id":"t0ecf6c9"
410acec
t0ecf6c9
"name":"39457e2","id":"s66045f2"
39457e2
s66045f2
然后捉name value 的$exp = StringRegExp($html, '"name":"(.*?)","value":"(.*?)"', 4)
If @error = 0 Then
For $i=0 To UBound($Exp)-1
$tmpary=$exp[$i]
For $j=0 To UBound($tmpary)-1
ConsoleWrite($tmpary[$j]&@CRLF)
Next
ConsoleWrite(@CRLF)
Next
EndIf
由于正则不对,所以得不到我想要的结果,把中间一段的包含进去。"name":"410acec","id":"t0ecf6c9"},{"type":"hidden","name":"39457e2","id":"s66045f2"},{"type":"hidden","name":"_t","value":1383019930},{"type":"hidden","name":"dfbe04c","value":"abcad67"
410acec","id":"t0ecf6c9"},{"type":"hidden","name":"39457e2","id":"s66045f2"},{"type":"hidden","name":"_t","value":1383019930},{"type":"hidden","name":"dfbe04c
abcad67
预期是这样的"name":"_t","value":1383019930
_t
1383019930
"name":"dfbe04c","value":"abcad67"
dfbe04c
abcad67
应该修改正则所以达到目的吧,只把紧贴name id 和name value匹配出来,能否在我的思路上帮我改改。。 |