Hi, I am trying to use Regular Expressions to modify text without modifying the wildcard value. Here is an example:
import re text = 'Reference  and Reference  are References.' text = re.sub('Reference \[\d+\]','Ref. [\d]',text) print text
I want the output to be "Ref.  and Ref.  are References", but here is what I get:
Ref. [\d] and Ref. [\d] are References. Is there a simple way to do this?