Posted by Jamie Alessio on 03/30/05 03:26
> 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
[Back to original message]
|