$str='<package name="com.android.emulator.gps.test"' & @crlf & _
'codePath="/system/app/GpsLocationTest.apk"' & @crlf & _
'nativeLibraryPath="/data/app-lib/GpsLocationTest" flags="48709"' & @crlf & _
'ft="13cd42b5c48" it="13ae2db2680" ut="13cd42b5c48" version="17"' & @crlf & _
'userId="10016">' & @crlf & _
'<sigs count="1">' & @crlf & _
'<cert index="0" />' & @crlf & _
'</sigs>' & @crlf & _
'</package>' & @crlf & _
'<package name="com.android.development"' & @crlf & _
'codePath="/system/app/Development.apk"' & @crlf & _
'nativeLibraryPath="/data/app-lib/Development" flags="572997"' & @crlf & _
'ft="13cd42b5c48" it="13ae2db2680" ut="13cd42b5c48" version="1"' & @crlf & _
'userId="10014">' & @crlf & _
'<sigs count="1">' & @crlf & _
'<cert index="1" />' & @crlf & _
'</sigs>' & @crlf & _
'</package>'
MsgBox(0,"",$str)
$str=StringRegExpReplace($str,"[\s\S]*?(GpsLocationTest\.apk|Development\.apk)[\s\S]*?version\=""(\d+)[\s\S]*?\<\/package\>\s*","$1=$2"&@crlf)
MsgBox(0,"",$str)
试一下 |