java 使用正则切分 16 进制字符串,"1d43000000000100010001000000000000000000000001001900cfff00000f0023001900803e" 希望每两个为一组;试验过 s.split("[0-f]{2}/g");并没有切分成功,在此求助广大 V 友~
1
xxyang 2020-05-15 10:26:10 +08:00
/g 去掉看看
|
2
yuan434356430 OP 去掉就没有分割了
|
3
acthtml 2020-05-15 10:39:53 +08:00
s.match(/.{2}/g)
|
4
toku 2020-05-15 11:22:09 +08:00
s.split("(?<=\\G..)");
https://stackoverflow.com/questions/50365295/how-does-g-work-in-split?r=SearchResults |