Correctly handle 2 byte segments ending with a 1 byte segment

This commit is contained in:
Thomas 2025-06-06 01:31:49 +01:00
parent 3a2f2c7344
commit 142e0d85a1

View file

@ -43,7 +43,7 @@ class FromHexdump extends Operation {
*/ */
run(input, args) { run(input, args) {
const output = [], const output = [],
regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )*[\dA-F]{2,4}|(?:[\dA-F]{2} )*[\dA-F]{2})/igm; regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )+(?:[\dA-F]{2})?|(?:[\dA-F]{2} )*[\dA-F]{2})/igm;
let block, line; let block, line;
while ((block = regex.exec(input))) { while ((block = regex.exec(input))) {