notepad++ hexadecimal number plus prefix 0x

1. Use the regular expression replacement function of notepad++

000102030405060708090a0b0c0d0e0ff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff

Regular search string ([0-9a-fA-F]{2}), replacement string 0x\1, result:

0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff,

Reverse replacement, search string 0x([0-9a-fA-F]{2}), replace string \1, result:

000102030405060708090a0b0c0d0e0ff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff

2. Use the macro function of notepad++

    1) Click the beginning of the string, click "Macro" -> "Start Recording",

    2) Enter "0x", move the cursor two digits to the right, enter ",", and click "Macro" -> "Stop Recording".

    3) Click "Macro" -> "Run Macro Repeatedly", enter 31 times to run.

Guess you like

Origin blog.csdn.net/beebeeyoung/article/details/107729250