Let's say I have the following body of text:
Call me Ishmael. Some years ago- never mind how long precisely- having little
or no money in my purse, and nothing particular to interest me on shore, I
thought I would sail about a little and see the watery part of the world. It is
<?xml version="1.0" encoding="utf-8"?>
<RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ChildElement />
<ChildElement />
</RootElement>
a way I have of driving off the spleen and regulating the circulation. Whenever
I find myself growing grim about the mouth; whenever it is a damp, drizzly
November in my soul;
What regex could I use that would return to me the XML embedding in the string?
NOTE: I can assume that <RootElement>
and </RootElement>
will always have the same name.