I am having difficulties replacing exact insensitive match of a string without affecting bigger strings having part of the string of interest.
What I mean is: if I have a string "INFO", I want to replace it with "INFORMATION" and if for instance I find a string "INFOR" I do not want to do anything because it is not exact match of "INFO".
I did this in python:
string = re.compile(re.escape("info"), re.IGNORECASE)
string = string.sub("information", "This might be related to info disclosure. Because Infor disclosure....")
print(string)
I am getting as output:
This might be related to information disclosure. Because informationr disclosure....
which is not what I want because infor is being replaced by informationr
Any way to solve this?