Roman Neuhauser wrote: > # jochem@xxxxxxxxxxxxx / 2007-01-24 23:55:27 +0100: >> Roman Neuhauser wrote: >>> Are you doing this to learn regular expressions or are you actually >>> trying to do work? Because you're going the wrong way. >>> It's XML, why do you treat it as text? >> not everyone shares that sentiment. in terms of lowest common denominator >> XML is also a string. then there is the question of whether it's actually >> marked as XML, whether there is valid DTD and whether the XML itself validates >> against the DTD - if any of the answers is 'no' then your looking at tag soup. > > as long as it's wellformed he can use it for what it is: a serialized > composite structure, like the result of serialize($aTreeOfObjects). > You can use preg_match() to extract a subset of the tree, but why bother > if you have unserialize($aTreeOfObjects)->getElementById("foo")? nothing to do with this argument but: this reminds of a thread on internals where someone was trying to determine if a serialized data was *safe* to run ... the data was coming from a cookie (I think), unserializing the data without first checking it didn't contain something evil was a bad idea - the proposed solution was a fairly simple regex that checked for 'object' notation in the serialized string. :-) > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php