Search code examples
regexreplacenotepad

hex number case change with notepad++ regex


in a sentence in a file in a far off galaxy "uint32_t per = 0x400e10b4u;"

i want to change the case of all the hex numbers in header files using notepad++ find and replace with regex.

i can find the "400e10b4u" part of the number using the expression "(= 0x)(\w+)" in the find box, but cannot figure out how to replace the lowercase to upper case.

Notepad version 7.5.6 so im led to believe it can be done


Solution

  • Regex: (?<=0x)(\w+)

    Replace with: \U$1

    \U is for UpperCase Transformation

    Demo