J
J Wolfe
Hi,
Is there a way to flag re.sub not to replace a portion of the string?
I have a very long string that I want to add two new line's to rather
than one, but keep the value X:
string = "test........X.\n.today" <-- note X is a value
string = re.sub("test........X.\n.","test........X.\n\n.", string)
This just replaces X with the replacement string.
Thanks,
Jonathan
Is there a way to flag re.sub not to replace a portion of the string?
I have a very long string that I want to add two new line's to rather
than one, but keep the value X:
string = "test........X.\n.today" <-- note X is a value
string = re.sub("test........X.\n.","test........X.\n\n.", string)
This just replaces X with the replacement string.
Thanks,
Jonathan