[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Henry Grech-Cini
Hi All, I don't actually think regexp is fault. But if anyone could explain this or give me some example code that will extract the attributes and data between a fieldset tag pair I would be appreciated. Henry Henry Grech-Cini [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All,

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: ... $regexp=/fieldset([^]*)[^(\/fieldset)]*/i; ... $result=extractFieldsets('testfieldset attribute=hellocontent of hello/fieldsetemblah/emfieldset attribute=goodbyegoodbye/fieldset'); ... And it produced; (0)= (0)=[fieldset attribute=hellocon] (1)=[fieldset

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Henry Grech-Cini
Thanks Sven, You are quite right with your some probs comment. Do you know what the the switch is that catches only the least result? I now get (0)= (0)=[fieldset attribute=hellolegendhello legend/legendcontent of hello/fieldsetemblah/emfieldset attribute=goodbyegoodbye/fieldset] (1)= (0)=[

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: Thanks Sven, You are quite right with your some probs comment. hi, think i found it. try this: ?php $rx = '/fieldset.*(.*)\/fieldset/iU'; ? the '/U' stands for 'ungreedy'. also note the change in the attribs-regex. hth SVEN -- PHP General Mailing List