示例:
03,00,00,00,01,00,00,00,14,00,00,00,10,9f,1c,ae,d6,45,bb,78,b3,ea,\
2b,94,c0,69,7c,74,07,33,03,1c,0f,00,00,00,01,00,00,00,10,00,00,00,05,85,87,\
0a,20,bd,9e,68,5a,85,14,a9,82,bb,2b,e2,18,00,00,00,01,00,00,00,10,00,00,00,\
3f,c8,cb,0b,c0,52,41,e5,8d,65,e9,44,8b,2d,07,c2,19,00,00,00,01,00,00,00,10,\
00,00,00,83,b6,53,18,66,4e,6f,a2,45,e0,d7,60,9f,b9,58,20,14,00,00,00,01,00,\
00,00,14,00,00,00,26,5d,05,07,d8,2f,a2,60,84,bd,83,7d,f5,21,80,a7,05,6f,5a,\
(略)
需求:
03,00,00,00,01,00,00,00,14,00,00,00,10,9f,1c,ae,d6,45,bb,78,b3,ea,2b,94,c0,\
69,7c,74,07,33,03,1c,0f,00,00,00,01,00,00,00,10,00,00,00,05,85,87,0a,20,bd,\
9e,68,5a,85,14,a9,82,bb,2b,e2,18,00,00,00,01,00,00,00,10,00,00,00,3f,c8,cb,\
0b,c0,52,41,e5,8d,65,e9,44,8b,2d,07,c2,19,00,00,00,01,00,00,00,10,00,00,00,\
83,b6,53,18,66,4e,6f,a2,45,e0,d7,60,9f,b9,58,20,14,00,00,00,01,00,00,00,14,\
00,00,00,26,5d,05,07,d8,2f,a2,60,84,bd,83,7d,f5,21,80,a7,05,6f,5a,85,04,00,\
00,00,01,00,00,00,10,00,00,00,09,c2,54,bd,e4,ea,50,f2,6d,14,97,f2,9c,51,af,\
6d,20,00,00,00,01,00,00,00,13,04,00,00,30,82,04,0f,30,82,02,f7,a0,03,02,01,\
02,02,0a,19,8b,11,d1,3f,9a,8f,fe,69,a0,30,0d,06,09,2a,86,48,86,f7,0d,01,01,\
我测试用的是 Emeditor 8.06,是 Perl 引擎,据说 Perl 5.6 之后,引入了递归。我是这样替换的:
find: \\\n((..,){n})
replace with: \1\\\n
{n} 初始值 3,每替换一次需要加 2,才能得到需求结果。是否存在更有效的写法?而不是每换一行改一次花括号内的值。任何平台任何正则引擎/语法都可以,回帖时注明就可以了。谢谢。