I am trying to figure out a regex search and replace for a text file import. There are hexadecimal values that need to be surrounded by the mysql char() function.
There is a comma and a space proceeding the value and a comma immediately after.
I am using a search and replace in my text editor, Notepad++
Examples of input:
, 0x31,
, 0x3137,
, 0x333731393831,
Desired result:
, char(0x31),
, char(0x3137),
, char(0x333731393831),
Thank you
Replace
, (0x[0-9a-f]+),with, char(\1),, with “Match case” unselected and “Regular expression” selected: