我到目前为止:找到([0-9A-Fa-f]{2})
并替换为,0x\1
,但这会在匹配表达式的每2个字符前面添加0x
。如何才能在([0-9A-Fa-f]{2})
=
例如:
TV = 0xB11BAB56
CAT = 0x9D3DCB7A
我需要什么:
TV = 0xB1, 0x1B, 0xAB, 0x56
CAT = 0x9D, 0x3D, 0xCB, 0x7A
答案 0 :(得分:1)
对于您的具体示例,我会使用将echo ("First UID is: ".$data->tst[0]->UID);
替换为= 0x([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})