I am looking for a regular expression to match:
[document n] m
in order to get rid of [document n] only when n=m
where n is any number
So [document 34] 34 will be a match but [document 34] 45 would not because the numbers are different
So far I have this:
import re
text = "[document 23] 23 and [document 34] 48 are white"
text = re.sub(r"(\[document \d+\] )(\d+)",r"\2. ",text)
But this does not assure thar the the numbers are equal.
Any idea?
dmatchesd,\dmatches digits.\d+instead of "+d\"?