remove NUL
Posted: Wed Aug 28, 2024 6:58 pm
I opened a backup .bk of a bootcode file to look around and see what was in it with notepad++. There were a lot of
/x00
NUL characters
But I could not remove them with that even with a simple expression. So I used this to FIND and REPLACE with a
/n
newline character
From guy038 read at
https://community.notepad-plus-plus.org ... -spacing/6
Which as you can see removes all of these hexadecimal characters
Regular expression cheatsheet
https://gist.github.com/jonlabelle/3893f6ac9447f7ee27fe
\xff Matches ASCII hexadecimal character ff.
\x{ffff} Matches UTF-8 hexadecimal character ffff.
Here's a list of \unicode characters:
https://www.fileformat.info/info/unicod ... c/list.htm
U+0000 NULL
U+0001 START OF HEADING
U+0002 START OF TEXT
U+0003 END OF TEXT
U+0004 END OF TRANSMISSION
U+0005 ENQUIRY
U+0006 ACKNOWLEDGE
U+0007 BELL
U+0008 BACKSPACE
U+0009 CHARACTER TABULATION
U+000A LINE FEED (LF)
U+000B LINE TABULATION
U+000C FORM FEED (FF)
U+000D CARRIAGE RETURN (CR)
U+000E SHIFT OUT
U+000F SHIFT IN
U+0010 DATA LINK ESCAPE
U+0011 DEVICE CONTROL ONE
U+0012 DEVICE CONTROL TWO
U+0013 DEVICE CONTROL THREE
U+0014 DEVICE CONTROL FOUR
U+0015 NEGATIVE ACKNOWLEDGE
U+0016 SYNCHRONOUS IDLE
U+0017 END OF TRANSMISSION BLOCK
U+0018 CANCEL
U+0019 END OF MEDIUM
U+001A SUBSTITUTE
U+001B ESCAPE
U+001C INFORMATION SEPARATOR FOUR
U+001D INFORMATION SEPARATOR THREE
U+001E INFORMATION SEPARATOR TWO
U+001F INFORMATION SEPARATOR ONE
/x00
NUL characters
But I could not remove them with that even with a simple expression. So I used this to FIND and REPLACE with a
/n
newline character
From guy038 read at
https://community.notepad-plus-plus.org ... -spacing/6
Code: Select all
(?!\t|\r|\n)[\x00-\x1f]
Regular expression cheatsheet
https://gist.github.com/jonlabelle/3893f6ac9447f7ee27fe
\xff Matches ASCII hexadecimal character ff.
\x{ffff} Matches UTF-8 hexadecimal character ffff.
Here's a list of \unicode characters:
https://www.fileformat.info/info/unicod ... c/list.htm
U+0000 NULL
U+0001 START OF HEADING
U+0002 START OF TEXT
U+0003 END OF TEXT
U+0004 END OF TRANSMISSION
U+0005 ENQUIRY
U+0006 ACKNOWLEDGE
U+0007 BELL
U+0008 BACKSPACE
U+0009 CHARACTER TABULATION
U+000A LINE FEED (LF)
U+000B LINE TABULATION
U+000C FORM FEED (FF)
U+000D CARRIAGE RETURN (CR)
U+000E SHIFT OUT
U+000F SHIFT IN
U+0010 DATA LINK ESCAPE
U+0011 DEVICE CONTROL ONE
U+0012 DEVICE CONTROL TWO
U+0013 DEVICE CONTROL THREE
U+0014 DEVICE CONTROL FOUR
U+0015 NEGATIVE ACKNOWLEDGE
U+0016 SYNCHRONOUS IDLE
U+0017 END OF TRANSMISSION BLOCK
U+0018 CANCEL
U+0019 END OF MEDIUM
U+001A SUBSTITUTE
U+001B ESCAPE
U+001C INFORMATION SEPARATOR FOUR
U+001D INFORMATION SEPARATOR THREE
U+001E INFORMATION SEPARATOR TWO
U+001F INFORMATION SEPARATOR ONE