I need to clean up an xml file before I can process it. The file has junk at the start and end, and then junk in between elements. Here is an example file:
junkjunkjunkjunk<root>
\par junkjunkjunkjunkjunk<level1>useful info to keep</level1>
</root>
junkjunkjunkjunk
How do I use regex to cut out (with replace?) the start and end junk, and then the middle junk? The middle junk always starts with "\par ...".