lets say I have the following string:
s = """hi my name is 'Ryan' and I like to 'program' in "Python" the best"""
I would like to run a re.sub that would change the following string to:
"""hi my name is '{0}' and I like to '{1}' in "{2}" the best"""
This would let me save content, but have a reference to it so that I could add the original content back in.
note: I use the following code to grab all of the items in quotes so I would loop through this to make reference to the numbers
items = re.findall(r'([\'"])(.*?)\1',s)
So how can I make it so the sub will recognize the number instance so I can create this kind of reference?