本帖最后由 C.L 于 2010-8-7 22:52 编辑
回复 35# pusofalse
还是P版厉害,没想到这里的两个字节可以互换,没办法只能单独对双字节进行处理了,代码在下面
回复 33# afan
是的,那个多余了,我原来是用(\S{2})来做的,后来改成1了,懒得改,就成这样了,呵呵~~
修改了下代码,对双字节进行了处理
补充:‘纪’字二进制是:0xBCCD,'图'字二进制是:0xCDBC#include <array.au3>
Dim $a = "123456789abcdefg双字图123456789abcdefg节"
Dim $b = "双纪abcdefg123456789字abcdefg123456789节"
$aU = StringRegExpReplace($a, '.*?([^\x00-\xff]).*?', '$1')
$bU = StringRegExpReplace($b, '.*?([^\x00-\xff]).*?', '$1')
$a = StringRegExpReplace(StringTrimLeft(StringToBinary($a), 2), "(\S)", "+0x$1")
$b = StringRegExpReplace(StringTrimLeft(StringToBinary($b), 2), "(\S)", "+0x$1")
$c = StringRegExpReplace(StringTrimLeft(StringToBinary($aU), 2), "(\S{4})", "+0x$1")
$d = StringRegExpReplace(StringTrimLeft(StringToBinary($bU), 2), "(\S{4})", "+0x$1")
MsgBox(0, "", Execute($a) == Execute($b) And Execute($c) == Execute($d))
|