Re: Regular Expression Problem

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

 



# rluckhurst@xxxxxxxxxxxxx / 2007-01-25 09:27:59 +1100:
> I must be dumb as I have been battling my way through regular expression
> examples for a while and I can not work out why the following does not work
> properly. I am the first to admit that regular expressions confuse me greatly.
> 
> The string is a piece of XML as follows and I have put that string into a
> variable called $xml_string
> 
> 
> <flights>
>          <flight flightId="19417361" addAdtPrice="0.0" addChdPrice="0.0" addInfPrice="0.0">
>                  <legXRefs>
>                            <legXRef legId="23862812" class="V"></legXRef>
>                            <legXRef legId="23862813" class="V"></legXRef>
>                  </legXRefs>
>          </flight>
>          <flight flightId="19417360" addAdtPrice="0.0" addChdPrice="0.0" addInfPrice="0.0">
>                  <legXRefs>
>                            <legXRef legId="23862810" class="V"></legXRef>
>                            <legXRef legId="23862811" class="V"></legXRef>
>                  </legXRefs>
>          </flight>
> </flights>
> 
> 
> What I am trying to do is extract the first <flight ..... /flight> chunk.
 
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?

-- 
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

-- 
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