Re: Some help on using regex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux