Re: Regular Expression Problem
| From: | Roman Neuhauser | Date: | Thu, 25 Jan 2007 00:11:14 +0000 |
| Subject: | Re: Regular Expression Problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247729@lists.php.net to get a copy of this message | ||
# jochem@iamjochem.com / 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")?
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991