Any questions involving matching text strings to patterns - the pattern is called a "regular expression."
Moderator: General Moderators
Ragnis
Forum Commoner
Posts: 31 Joined: Thu Nov 13, 2008 12:35 pm
Location: Saaremaa, Estonia, Europe, Asia, Planet Earth, The Solar System, Milky way.
Post
by Ragnis » Tue Jan 05, 2010 4:32 am
I have the following XML:
Code: Select all
<root>
<set key="sth" />
<uname>Somebody</uname>
<container>
<uname>Somebody</uname>
<container>
Some content
</container>
</container>
Some text
</root>
Now i need a regex to get list of the elements:
or it can be also an array.
Last edited by
Ragnis on Sat Jan 23, 2010 11:42 am, edited 1 time in total.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Tue Jan 05, 2010 12:14 pm
Have you tried SimpleXML first?
(#10850)
Ragnis
Forum Commoner
Posts: 31 Joined: Thu Nov 13, 2008 12:35 pm
Location: Saaremaa, Estonia, Europe, Asia, Planet Earth, The Solar System, Milky way.
Post
by Ragnis » Sat Jan 23, 2010 7:24 am