How can I write a regular expression to retrieve values from xml node? Actually the node structure is very big. So we can't traverse easily, so I want to read as normal text file and hope I can write a regex to find out the matching elements.
<node1>
<node2>str</node2>
<node3>Text</node3>
<myvalue>Here is the values string..</myvalue>
</node1>
The above is the pattern I want to retrieve values <myvalue></myvalue>
but in my xml there are so many other node contains the <myvalue>
child. So only way to find out the appropriate node which I want is in the above pattern. The only change in value rest of the node values are same <node2>str</node2>
, <node3>Text</node3>
are always same.
So how can I write the regex for php?