[Tfug] Regexps

George Cohn gwcohn at simplybits.net
Thu May 3 06:58:00 MST 2007


Stephen Hooper wrote:
> On 5/3/07, Robert Hunter <hunter at tfug.org> wrote:
> 
>>Actually, the best solution would use a XML library.  I know Perl can has
>>XML stuff.  I would be surprised if PHP did not.
> 
> 
> I guess that depends on what you are trying to solve for him.  He
> obviously has a solution that he thinks almost works for him, and he
> is the "man on the ground".
> 

I'm using PHP5.

I think I have a solution but haven't had time to try it.  Using 
Preg_Match_All I can parse each piece of the expression and store them 
in an array.  Then I can just call the first and last array and get the 
two numbers I want.

Spent a few minutes last night reading over the php portion of the 
O'Reilly book on regexps.  ;-)

George Cohn




More information about the tfug mailing list