Re: Some help on using regex

From: Date: Wed, 30 Mar 2005 00:26:36 +0000
Subject: Re: Some help on using regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-211827@lists.php.net to get a copy of this message
Im having a problem matcing some code using preg_match_all. The regex statement needs to be very flexiable. The code im using is: <project>(\n| |.)+<project> [snip]
-==- Output from socket -==- <project>
    <master_url>http://climateprediction.net/</master_url>
    <project_name>climateprediction.net</project_name>
    <user_name>Bob</user_name>
Why are you trying to parse this data with a regex? It looks like XML data to me so you should be able to easily break the data up using PHP's XML functions. If you're using PHP5 take a look at http://us3.php.net/simplexml and if you're using PHP4 there a number of other options but I'm not familiar enough with any of them to give a recommendation. - (a different) Jamie

« previous php.general (#211827) next »