Problem:
str = "never asserted as the ''only'' sufficient condition for ''Q'', other factors could account for ''Q'' (while ''P'' was false).<ref>{{cite web |url = http://www.fallacyfiles.org/afthecon.html |title = Fallacy Files |work = http://www.fallacyfiles.org |publisher = Fallacy Files |accessdate = 9 May 2013}}</ref>To put it differently"Replace <ref>.*</ref> by ''
Solution:
import restr = re.sub(r'<ref>.*</ref>', "", str)
print str
No comments:
Post a Comment