I need help with this re.sub function.
For example, if I wanted to replace "string" with "abc"
but I want #include <string.h> to remain the same so that the syntax does not get disturbed and all the other "string" variables get replaced with "abc". How can I write the re.sub function?
The Python code is:
result = re.sub("string","abc", test_str, 0)
test_str is this
#include <string.h>
#include <stdlib.h>
char *Function(unsigned char *string, unsigned char *key)
{
unsigned int i, j;
for (i = 0; i < s(string); i++)
{
string[i] = ~ string[i];
}
return string;
}