I am trying to strip XML tags from a document using Python, a language I am a novice in. Here is my first attempt using regex, whixh was really a hope-for-the-best idea.
Please, note, that usually it is not normal to do it by regular expressions. See Jeremiah answer.
Try this:
import re text = re.sub('<[^<]+>', "", open("/path/to/file").read()) with open("/path/to/file", "w") as f: f.write(text)